strange javascript error Uncaught SyntaxError: Unexpected token ILLEGAL

Possible Duplicate:
SyntaxError: Unexpected token ILLEGAL

I was working 2hours aho and now I comeback on my code and I have in chrome console

Uncaught SyntaxError: Unexpected token ILLEGAL

in my function.js

I only have:

function test(){
    alert("aa")​
}

I also have an error on firefox

Thanks


Look what I found:

Looks like you have an illegal character right after the closing parenthesis. I don't know how that got there, but deleting it should make it work.


Try checking your original source for trailing white-space characters, and add a line-terminator after the alert call. The semi-colons are optional, but it's best to include them really.

function test()
{
    alert('aa');//<-- check for trailing white-space here
}//<-- and here, too

重新键入代码而不是复制粘贴,代码中可能会有一些不可见的字符。

链接地址: http://www.djcxy.com/p/58080.html

上一篇: 意外令牌非法使用JavaScript For Loop

下一篇: 奇怪的JavaScript错误未捕获的SyntaxError:意外的令牌非法