SyntaxError:非法字符 [英] SyntaxError: illegal character
本文介绍了SyntaxError:非法字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我对此代码的最后一行有疑问。在firebug / console中我看到
I have problem with with last line of this code. In firebug/console I see
SyntaxError:})之后的非法字符;
当我查看firebug / script时,我看到});< / script>
。我不知道如何删除它。
When i look in firebug/script i see });a</script>
. I don't know how to delete it.
<script type="text/javascript" >
$(function() {
$('#filput').checkFileType({
allowedExtensions: ['jpg', 'jpeg'],
success: function() {
alert('Success');
},
error: function() {
alert('Error');
}
});
});</script>
推荐答案
在<$ c之前你确实有一个不可打印的字符$ c>< / script> 代码。幸运的是,jsFiddle表明了这一点: http://jsfiddle.net/byg7b/ 。
You have indeed an unprintable character before the </script>
tag. Fortunately jsFiddle shows it: http://jsfiddle.net/byg7b/.
如何删除它?
在编辑器中打开文件,移动光标在< / script>
之前,按退格/删除,直到删除;
。然后再次添加;
。
Open the file in your editor, move the cursor before </script>
and press backspace/delete until you delete ;
. Then add ;
again.
这篇关于SyntaxError:非法字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文