Script debugging tips
Monica wrote a very nice document for this feature.
A few quick highlights:
- Internet explorer defaults to having script debugging disabled. IE also likes to disable script debugging when you install a new version of IE (example: XP SP2). In IE, go to Tools->Internet Options->Advanced. Prior to Windows XP SP2, the option you needed to uncheck was 'Disable Script Debugging'. In XP SP2, the IE team decided to split this into two separate options – 'Disable Script Debugging (Internet Explorer)' and 'Disable Script Debugging (Other)'. The 'Other' option control script debugging in other applications that use mshtml.dll such as Outlook.
- Try to keep all of your script running in the same script block. IE will sometimes get confused if you have more then one.
- To debug client side script that is in a .ASPX file, you will need to either open the .ASPX file from the Running Documents window (called the 'Script Documents' window in Visual Studio 2005), or set a breakpoint by function name (Ctrl-B).
Comments
- Anonymous
September 17, 2004
When tring to log onto AOL, I get many screens that state a script error and Just-In-Time notices.
In browsing,disable script debugging is checked but the notices still appear.
What else can I do?
Perry Gerhart - Anonymous
September 17, 2004
What kind of exception are you getting? - Anonymous
September 19, 2004
The only thing I've found that works fairly consistently is the 'debugger;' statement. If you've got a lot of script in different blocks and files sometimes this is the only way to get the debugger to stop where you want, especially if your script is in a .htc! Even then, you're not always guaranteed the debugger will be pointing at actual code when it stops.
I recently finished a lengthy complicated web application project and the script debugger was probably the one thing that caused me the most grief, hair pulling and cursing throughout the life of that project.