1 Internet Explorer Options First enable debugging in IE: go to Tools > Internet Options > Advanced, and make sure “Disable Script Debugging (Internet Explorer)” is unchecked and “Display a notification about every script error” is checked.
2 Then Download and install VWD
3 Adding a new empty website in Visual Web Developer Create a new empty website
4 Start Debugging

Click the “Start Debugging” button. You will be prompted to enable debugging for this website – do so. VWD will then launch IE in debugging mode.Since your website is empty you will see a 404; ignore it and navigate to the actual page or website you want to debug.

A tip from Fraser in the comments below: If you like, you can create a home page for the new site, and add this code to the head section: <meta http-equiv=”refresh” content=”0;url=http://yoursite.com”>. This will redirect you automatically to your chosen site.

5 JavaScript debugging in Visual Web Developer Express Any script errors will cause IE to pause execution and transfer control to VWD.The screenshot to the left shows me changing the value of a variable as the script is paused.

If any Firefox users have probelms getting VWD to launch IE, see James Wiltshire’s comment below.
A few debugging tips:

  • Learn these shortcuts: Step Over (F10) executes the current line of code and moves to the next one. If the current line of code contains a function call, Step Into (F11) moves the debugger into that function call. Step Out (Shift+F11) executes the rest of the current function and pauses again after it returns. Continue (F5) resumes the script until the next error or breakpoint.
  • Debugging is easier if you write code with one function call per line, so that the debugger knows which function you want to step in to.
  • You can type any expression in the Watch window, and when its value changes it will turn red.
  • If you want to open the debugger when there is no error, click in the left-hand margin to set a break point or place the ‘debugger’ keyword in your code (this works in Firebug too).
  • The Script Explorer window is an extremely useful list of open JavaScript and HTML files that you can use to find code in order to set a breakpoint. It is not shown by default but you can enable it in Debug > Windows > Script Explorer.

Happy coding!

* joke stolen from Rowan Atkinson


Then, I faced the Firefox problem ! as Firefox is my primary internet browser, so there is a comment in the same article which describes how to solve this, here’s it :

. It turns out you have to right click on your empty website project in
the ‘Solution Explorer. There’s an option in there ‘Browse With…’ that
allows you to choose IE/Firefox/Internal browser.