2

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

Community
  • 1
  • 1
Ajouve
  • 9,735
  • 26
  • 90
  • 137

3 Answers3

8

Look what I found:

enter image description here

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.

David G
  • 94,763
  • 41
  • 167
  • 253
0

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
Elias Van Ootegem
  • 74,482
  • 9
  • 111
  • 149
0

Retype the code instead of copy paste, there might be some invisible characters in the code.

Aviram Segal
  • 10,962
  • 3
  • 39
  • 52
MReis
  • 56
  • 1
  • 2