views:

114

answers:

3

I am working on a relatively complex JavaScript-driven website. It runs great in all browsers except Internet Explorer (7, this particular version is our corporate standard). I am getting this very curious error:

"A Runtime Error has occurred. Do you wish to Debug? Line: 93,865,600. Error: Expected ';'"

The issue is, I don't have 93 million lines of code, and clicking "Yes" doesn't attach to Visual Studio like it normally does.

I can click on 'No' and the website continues to run fine, but if a user doesn't have JavaScript debugging disabled, I don't want them to see this meaningless error.

Suggestions/Tools/Plugins to get to the bottom of this?

And yeah, I learned my lesson, switch over and check my project in Internet Explorer more often...

Thanks,

+1  A: 

Here are a couple of debugging tools I use on IE.

AND within IE, get it to scream about every other error that it encounters under Options. Here are the instructions to do so, you can also read the very useful debugging tips in the presented in the slideshow.

This will give a better picture where the error is occurring. If that doesn't work, you might want to try breaking down your scripts by not including parts of it, to see which parts or which particular JS script file is giving you problems.

bron
I actually saw that page before I posted this, and made sure those checkboxes are unchecked as well as tried MS Script Debugger, with no luck. IE Developer Toolbar doesn't seem to give me any useful tools to track this down, and Firebug Lite has the odd side effect of suppressing the error...
Erik W
A: 

I would also use Fiddler2 to view the exact files that are being given to the browser. There may be code on the server that adjusts the files before they are sent. Using Fiddler, you can see what the browser is receiving.

Also make sure you are using IE8, as the Developer Toolbar is built in to it. If not IE8, download the IE Developer Toolbar, as 'bron' said.

Glen Little
When using IE8, be sure to turn on script debugging. You can then debug directly inside IE, without attaching to Visual Studio.
Glen Little
Unfortunately I'm on IE7, because that is what the application users will have. There is no mechanism that would cause different scripts to be delivered because of the current browser.
Erik W
+2  A: 

It's not strictly a debugging tool, but I wouldn't be surprised if Ajax DynaTrace helped you track down the weirdness.

http://ajax.dynatrace.com/pages/learn/solution-tour/ajax-performance-diagnostics.aspx

Also, run your code through JSLint. The error message makes it sound like you have a subtle syntax error that some browsers tolerate.

Nosredna
+1 for dynatrace!
Sean Vieira
Dynatrace helped me track it down to some JQuery code after a JSON-P call:head.insertBefore(script, head.firstChild);I understand this is a very fragile call in IE7 if any of the HTML is invalid...This is a great start, thanks for your help!
Erik W
Glad to hear you're making progress.
Nosredna