當前的jQuery使用未捕獲的SyntaxError:意外的標記{
$("#like_button").live("click", function(){
var status = $(this).data("status");
var id = $(this).data("id");
var count = $(this).html();
if(status === 1){
like(id);
$(this).removeClass("likes");
$(this).addClass("liked");
count++;
$(this).html(count);
}elseif(status === 2){
like(id);
$(this).removeClass("liked");
$(this).addClass("likes");
count--;
$(this).html(count);
} else {
// do nothing
}
return false;
});
的錯誤
Uncaught SyntaxError: Unexpected token { (Line 529)
這低於這條線,
}elseif(status === 2){
如果你需要再信息來幫助我這個請一定要問。
else和if之間有空格。 – ggreiner