views:

135

answers:

4

I'm using jQuery for my app and I'm getting this error in IE:

Line: 13
Char: 9
Error: Expected Identifier, string or number
Code: 0

..well, as you can see, the error isn't quite helpful. How do you fix those weird IE errors? Is there any tool or a list of error descriptions that tells you what to fix?

Thanks

+2  A: 

Here's an article on debugging javascript in IE. IE8 comes with a built-in debugger.

Annie
+1  A: 

The IE Script debugger is quite OK.

But try Mozilla's error console first. It has sane line numbering. Maybe the errors are identical.

Pekka
+5  A: 

I would suggest looking at line 13 of your JS file to find out where the error is.

FWIW, the "Expected Identifier, string or number" error often occurs when you have a trailing comma in a list or object declaration. Firefox doesn't mind this, but IE does.

mopoke
Exactly, it was an extra comma! :)
Nimbuz
A: 
  • Make sure you have Microsoft Office installed

  • In IE, go to Tools -> Internet Options -> Advanced tab

  • From there UNCHECK "Disable script debugging (Internet Explorer)"

  • Then when a script creates an error, you will be presented with a dialog box:

Script error in IE

Click the YES button to sign your life over to microsoft to start the debugger.

This is a really tedious workflow (the default sound that happens when a script bug is encountered is really annoying) so I don't think its a good way to work, recommend firefox error console over it any day.

See also.

bobobobo