2013-10-16 98 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(); 
      }); 
     }); 
} 

你错过了$就在关门();

相关问题