我收到此错误:
SyntaxError: missing '}' after argument list
使用此代码:
(function(d, debug){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all" +
(debug ? "/debug" : "") + ".js";
ref.parentNode.insertBefore(js, ref);
}(document, false));
var checkboxes = document.querySelectorAll('input[type="checkbox"]'),
numCheckboxes = checkboxes.length,
x;
$(function(){
// Set up so we handle click on the button
$('#like_all').click(function(){
for(x=0;x<numCheckboxes;x++) { //the error is indicated here
if (checkboxes[x].checked === true) {
FB.api(
'me/og.likes'
'post',
{
object: checkboxes[x].value;
},
function(response) {
if(response===null)
{
alert("Could not like page "+checkboxes[x].name);
}
}
)
}}})
});
什么样的语法错误会导致此错误,我该如何解决?