eozzy
eozzy

Reputation: 68650

Fixing JS errors in IE

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

Upvotes: 0

Views: 602

Answers (4)

bobobobo
bobobobo

Reputation: 67224

  • 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.

Upvotes: 1

mopoke
mopoke

Reputation: 10685

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.

Upvotes: 6

Pekka
Pekka

Reputation: 449385

The IE Script debugger is quite OK.

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

Upvotes: 1

Annie
Annie

Reputation: 6631

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

Upvotes: 2

Related Questions