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,095
  • 24
  • 83
  • 128

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
  • 90,891
  • 40
  • 158
  • 247
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
  • 70,983
  • 9
  • 108
  • 145
0

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

Aviram Segal
  • 10,792
  • 3
  • 38
  • 52
MReis
  • 56
  • 1
  • 2