views:

50

answers:

4

All I get is this:

An error has occurred in the script on this page
line: 31
char: 5
error: expected identifier, string or number
code: 0
url: http://example.com

It's difficult to find that line since I have several external and internal scripts.

How can I debug this? (By the way, the scripts have no errors in chrome or firefox or ie8+)

+1  A: 

If it says it's on the page, then it means the page itself. If it was in an external file, it would indicate that the error occured in something.js.

Open up your webpage, right click on the page and select "View Source". Go to line 31 and try and see what's wrong with it.

GenericTypeTea
A: 

Try debugging it with IE8's Developer Tools (press F12). You should be able to step through the JS code (from all your scripts) to find out what is wrong with line 31 / char 5.

Mike Atlas
+1  A: 

You can download IETester which lets you use various versions of IE (6-8) and has built-in developer tools. They're not spectacular, but they're better than the nothing that old versions of IE provide.

Adam J.R. Erickson
His question is "How do I debug this?" My answer is a suggestion for a tool to use to debug it. I think it should be an answer, not a comment.
Adam J.R. Erickson
+1  A: 

You can also enable debugging for IE at

(Tools -> Options -> (uncheck) Disable script debugging (Internet Explorer).  

After you disable it, IE will prompt you to debug when error occurs. Then you can debug with VS or MS script Editor.

Soe Moe