If you want to debug Jscript code in your web pages in IE, then you can make use of the "Visual Web Developer" (VWD) tool which is available as a free download from Microsoft website. VWD is a tool which is mainly used to author and debug your own web sites. However if you want to debug Jscript code in a web page which you have not authored or which is served from a remote web server or http location, then you need to create a dummy web site project in VWD and set it up to launch your web page when you start debugging.

Following are the exact steps to acomplish this:

  • Install VWD Express [Free download available from http://msdn.microsoft.com/vstudio/express/vwd/default.aspx]

  • Start Internet Explorer and enable script debugging by switching off the menu option in IE 'Tools -> Internet Options -> Advanced -> Browsing -> Disable script debugging'. Exit Internet Explorer, from now on all new invocations of IE will have script debugging enabled in it.

  • Start VWD. On Vista use 'Run as adminstrator' when starting VWD, so that it doesn't have problem connecting to IE for debugging.

  • In VWD, create a new empty website project. In this project edit its ‘Properties->Start Options->Start URL’ to launch the URL you want to debug. Preferably switch off ‘default debug server’ and ‘ASP.NET’ debugger also because you don’t need them for this simple client side debugging

  • In VWD ‘Start Debug’, it will launch IE with your URL. In VWD use ‘Debug->Windows->Script Explorer’, it will show your html page and other script files loaded in the page. Select the pages you are interested in debugging and set break points. Exercise the web page in IE, when it reaches your break points, VWD will come in focus automatically. Step thru, continue, check variables etc.

  • End of the debugging, close both IE as well as VWD. Preferably turn off script debugging in IE.

  • For next debugging session if you want you can re-use the same website project you have created above. If you want to debug a different web page, you can simply load that in internet explorer window which is launched from VWD, the script debugger will automatically start showing whatever web page you are currently browsing.