2013-10-16 97 views
-1

嗨,我有一個「未捕獲的SyntaxError:意外的標記}」 137行代碼的我阿賈克斯未捕獲的SyntaxError:意外的標記}

function removeItem(sender, itemCode){ 
    $.ajax({ 
     url: 'cart_update.php?removep=' + itemCode, 
     success: function(){ 
      var parent = $(sender).parent(); 
      parent.remove(); 
      }); 
     } ////137 
} 

一些幫助錯誤?

回答

1

記得關閉$就導致上述不需要);上線括號:

 }); ////137 
} 

只需添加一個「);」上線137

1

你缺少線收盤);標有////137

,你有////137

正確的代碼

function removeItem(sender, itemCode){ 
    $.ajax({ 
     url: 'cart_update.php?removep=' + itemCode, 
     success: function(){ 
      var parent = $(sender).parent(); 
      parent.remove(); 
     } 
    }); ////137 
} 
1

它改成這樣:

function removeItem(sender, itemCode){ 
    $.ajax({ 
     url: 'cart_update.php?removep=' + itemCode, 
     success: function(){ 
      var parent = $(sender).parent(); 
      parent.remove(); 
      }); 
     }); 
} 

你錯過了$就在關門();

相關問題