Tuesday, May 11, 2010

Internet Explorer JavaScript Debugging

Most of the time people frustrated with JavaScript errors since the lack of information provided by the browser. You can use alert’s to find out where it went wrong but this is annoying by number of clicks. So you have to use some debugging tools for browser.

 

If you are a .NET Developer, Visual Studio comes with inbuilt JavaScript debugging tool. But what if you are neither a .NET developer nor you have Visual Studio. In this case Microsoft provides a free tool called “Microsoft Script Debugger” which you can download it from here. As of i know, this is the free and best tool for debugging JavaScript on Internet Explorer.

 

To use either Visual Studio or Microsoft Script Debugger as your debugging tool, you have to turn debugging on in IE. To do that Go to Tools –> Internet Options –> Advanced tab. Make sure that “Disable Script debugging (Internet Explorer)” is not checked.

 

image

 

Once you restart the browser, you can load your page which you want to test it. If there are any errors on the page, it shows a Dialog box asking whether to debug or not and just press OK button. That’s it. Now you can see where exactly the error happens and analyze accordingly.

 

If in case you want to debug specific line irrespective of error. You can put a line debugger; in your JavaScript code. so it will create a break point automatically and when this breakpoint gets hit, your debugger will lunch.

 

Hope this helps some one.

0 comments:

Post a Comment