Member Avatar for stbuchok
stbuchok

I've seen a lot of people having issues debugging JavaScript code. So here is how you can easily debug your JavaScript code using Visual Studio (I believe firebug has similar functionality). Also if someone has Visual Web Developer can you confirm that you can do it in that as well (I'm not at home so I can't test right now).

When you have your project open, go to the Tools menu and click on "Attach to Process..." (also ctrl+alt+P). This will bring up a list of processes you can attach to. Select iexplorer.exe (there maybe multiple IE process if you have multiple ID browsers open, the title should display the title of the page that is open, this will allow you to distinguish between them). Once you've selected the proper process, click "Attach".

You can now set break points in your JavaScript code which gives you access to other tools for debugging as well.

As your JavaScript runs it will hit a break point and you are able to see what the value is and step through the code to see what is happening at each line.

I hope this helps. Please feel free to add to this in the comments or also add links to other tools for debugging JavaScript.