Friday, February 03, 2006

debug Javascript in Visual Studio .NET 2005

In VS.NET 2005, No need to put Debugger(in VS.NET 2003) keyword in your javascript. it will automatically debug the code, but before that, make sure the following in IE

IE and VS.NET both ship with nice javascript debugging support; here is the simple steps to get it to work:
1. Turn off "Disable script debugging". In IE go to Tools, Options, Avanced Tab and in the "Browsing" section make sure that "Disable script debugging" is NOT checked. Accept that change.
2. Open up VS.NET into your favorite solution, which of course includes some javascript markup.
3. Run the solution.
4. Once the project is ran, and the IE window is open jump back over to VS.NET.
5. Under the Debug menu, Windows, choose Script Explorer. This should show a window on the right side with a list of the running documents. It should show the aspx page any any .js files you have included. Open up any of the .JS files and set breakpoints in your code. Once the script is executed it should stop at your breakpoints and give you all the current watch funcationality that you have come to expect from VS.NET.

Followings are important steps while debugging with Mozilla:
Mozilla has a project named "Venkman" just for debugging.
Here is what I did in order to get this to work:
1. Install the extension from http://www.hacksrus.com/~ginda/venkman/ . Note: In order to get Firefox to actually install this you need to add the "hacksrus.com" to your trusted sites. I dont trust this guy so what I did was right click the XPI and saved it to my desktop. From there you can click and drag it into a Firefox window which it will then install it. Also, remember that an XPI is just a zip file with a bunch of content. Feel free to rename the .XPI file to a .ZIP and take a peek whats inside.
2. Once you have the extension installed you will need to recycle the browser, do so now.
3. Open up the Javascript debugger. It can be found under Tools, Javascript debugger.

this is an article by MSN group BDOTNET

0 Comments:

Post a Comment

<< Home