Today I was introduced to a new debugging feature in Visual Studio 2005 - debugging client side scripts. It is very easy to use. You just add the debugger keyword to your function and run the application (F5) as you would when you are debugging you code behind files.
<SCRIPT language="javascript">
function doSomething()
{ debugger
var intA = 2;
var intB = 5;
alert(intA + intB);
}
</SCRIPT>
Before starting, make sure that client side debugging is not disabled in IE (Internet Options -> Advanced).
Once the function gets called, it will stop at the debugger keyword. From there you can use F10 and F11 to step through you script. You have also access to the Immediate Window, Locals Window, Call Stack, Breakpoints, Watch windows... basically you get the same debugging support as you get for the code behind files.
There is a more extensive article available on:
http://geekswithblogs.net/lazydeveloper/archive/2006/07/10/84552.aspx
which also includes some troubleshooting tips.
Good luck!
Margus Lapp