You can debug client script by running it from within your Microsoft Visual InterDev solution, or by responding to a syntax or run time error in a script, called just-in-time debugging.
Note To debug client script in Microsoft Internet Explorer, you must be using Internet Explorer 4.0. Debugging must also be enabled in Internet Explorer (this is the default). It is also highly recommended that you do not use Active Desktop mode of Internet Explorer when you are debugging.
If the script is in a file that belongs to a project in the current solution, you can fix the error, and then restart the debugging session to see the effect of your change. If the error is in a page that does not belong to the current solution, you can view the script in a read-only window.
Before you can debug client script in ASP pages, you must enable debugging.
To enable client script debugging in ASP pages
Note To debug script in ASP pages, you must be running version 4.0 or later of Microsoft Internet Information Server (IIS).
If a Web page contains a mixture of client and server script, you can use the Visual InterDev debugger to debug both. For details, see Debugging Mixed Client and Server Script.
To debug a script from within a solution
Visual InterDev launches Internet Explorer and loads the page into it. If the breakpoint is in an event handler script, you might have to trigger the event. When Internet Explorer reaches the breakpoint, it stops and displays the source code in the editor window.
Tip You can also add a Stop
statement (in VBScript) or a debugger
statement (in JScript) to launch the debugger from within a script.
If a client script is already running in Internet Explorer and you detect a problem, you can stop the script and debug it on the spot.
To debug a running script
ûorû
ûorû
ûorû
If Internet Explorer encounters a syntax or runtime error, you can use just-in-time debugging to find and fix it.
To debug in response to an error
Visual InterDev starts, loads the document into the editor, and highlights the line of script that caused the error.
Note If you are debugging a client script generated by an .asp file, the line numbers reported in error messages refer to lines in the HTML document currently displayed in the browser. These usually do not correspond to line numbers in the original .asp file, because server script does not appear in the HTML output of an .asp file. For more information, see Debugging Mixed Client and Server Script.