Wednesday 19 March 2008

Debug JavaScript in VS2005

The basic steps are listed below:
  1. Make sure in IE6 under Tools > Internet Options > Advanced
    Disable Script Debugging (Internet Explorer) and
    Disable Script Debugging (Other) are unchecked
  2. Open VS2005 with your solution
  3. Open IE6 and browse to your page the JavaScript is on
  4. In VS2005 Debug > Attach To Process
    Click on Select... and make sure Script is checked
    Select IEXPLORER.EXE (Title = Your page)
    Click Attach
  5. In VS2005 Debug > Windows > Script Explorer
    You will see all debuggable JavaScript files
  6. Put a breakpoint in your JS code for debugging

Your done!

Helpful links:

http://geekswithblogs.net/lazydeveloper/archive/2006/07/10/84552.aspx

http://msdn2.microsoft.com/en-us/library/k2h50zzs(VS.80).aspx

No comments: