1

I am trying to figure out why a page is not working correctly in Internet Explorer 7.

I get a JavaScript error that says

error is on line 1958 char 7

My HTML code is only 534 lines with all of my JavaScript code externally linked.

How do I go about finding this error?

Does this error put all of the external files in the file which makes the number of lines more than my HTML code?

Would this be what I need to do to figure out where the error is in the JavaScript code?

2
  • Can you post the problematic code? Commented Apr 11, 2011 at 17:43
  • The problematic code looked like it was coming from jQuery 1.4.2 min so I went and went with a newer version and the error has gone away. Commented Apr 11, 2011 at 19:02

3 Answers 3

2

You should use Internet Explorer Developer Toolbar. It is extremely useful for debugging JS in IE.

I've also heard good things about Web Development Helper. (It even supports IE6!)

If you have Visual Studio, I would enabling script debugging in Advanced options. That may yield better debugging.

Sign up to request clarification or add additional context in comments.

2 Comments

I have been using that and all is working fine in IE 8 & 9. It is something that is messed up in 7 and below and I don't understand how it can tell me it is online 1958 when there are only 534 lines in my page?
I feel your pain, IE is absolutely terrible at JS errors and often points to the wrong line! (And in your case, a line that doesn't even exist).
0

My first instinct would be to try the site in Firefox and have a look at it with the Firebug plugin. I'm not sure what kind of debugger support is available in IE.

Comments

0

After installing Internet Explorer Developer Toolbar

window.onerror = function myErrorHandler(errorMsg, url, lineNumber) {
  debugger;
  console.log(errorMsg, url, lineNumber);
};

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.