Reputation: 9300
I think its the cause of trailing comma, or syntax error, variable used without declaration. My js fiel is 1000 lines od code. Since the error is not provding me the line no. Its becoming dfficult to debug. Please help me with debugging techniques for IE. The script works very well with Firefox, Safari.
Upvotes: 5
Views: 17679
Reputation: 41
I had this issue using the Extjs RowExpander user extension. The issue only occurred in IE. I was able to fix it by adding a few lines of code at the top of the 'toggleRow' method:
if (!this.view) {
this.bindView();
}
For some reason IE occasionally chokes on references to 'this.view' (likely a timing issue). Running 'bindview()' ensures that 'this.view' resolves appropriately.
Upvotes: 0
Reputation: 9300
Guys, I finally did it ? I took the strength of all your techniques.
1) I put the code in a single try{ code } and catch(e) { alert('Final Err: '+ e.description); }
and kept initial 200 lines uncommented and the rest commented and ran the file
while(EOF) {
if(got an alert of error)
checked for trailing commas & putting missed semicolons till end.
else
adding some more lines later uncommented out of the commented and ran the file.
}
Finally, the page got succesfully loaded !!!
Upvotes: 0
Reputation: 2216
If you are using eclipse :
configure spket plug-in editor for java script
It will highlight the missing/incomplete syntax (e.g comma/semicolon)
so you don't need to debug for syntax errors
Upvotes: 0
Reputation: 8376
I'd jslint the file. That will find the issue as well as any others you may have.
You can run it as a command line utility via node.
Upvotes: 5
Reputation: 5570
If you are developing through Microsoft Visual Studio I remember it will help you find trailing commas by highlighting the following }
element with a green curly underline.
If you use the built-in developer tools in IE8 and later, you can step through your code in the browser and determine which line causes the error - starting from the top.
If you are not using any debugging tools in IE, then I will advise you to - just like Johan and bjornd are suggesting.
Happy hunting :)
Upvotes: 1
Reputation: 618
include this <script type="text/javascript" src="https://getfirebug.com/firebug-lite-debug.js"></script>
and <html debug="true">
will give you an firebug console
http://getfirebug.com/firebuglite#Debug
Upvotes: 4