GuidesDebugging Client/Server Side Scripts

Debugging Client/Server Side Scripts




by Sandipan Datta

A facility for script debugging is something which we all need
when we write ASP or client-side scripts. Microsoft provides the
Microsoft Script Debugger with IIS 4.0. Otherwise the setup program
can be downloaded
from the Microsoft Web Site. On setting up the debugger, we need to
open IE. On clicking on the View menu item, if
Script Debugger appears ( as it will do if the setup
has gone right ), we are ready to debug!

A facility for script debugging is something which we all need
when we write ASP or client-side scripts. Microsoft provides the
Microsoft Script Debugger with IIS 4.0.

Now before we proceed further, a few things need to be set clear.
This debugger runs only on IE browsers. And server side code can
only be debugged by sitting on the server machine.

Client side debugging: To debug a client-side script, what
we need to do is simple. At the place where a breakpoint needs to be
set , type in the command debugger; for JavaScript. If
you are using VBScript for client-side scripting then the command is
stop Then start off the page/site. As the page
execution reaches the breakpoint, the Debugger opens up and the
subsequent code can be walked through as in other debugging
environments. To view variable values, we use the Command Window.
This is a window which can be opened by clicking Command
Window
on the View menu item in the Script
Debugger. Inside this, we can type in the variable name and press
enter. The current run-time value appears below the variable.

Server side debugging: To debug server side scripts, we
first need to enable ASP Debugging on IIS. To achieve this, we can
open the Internet Service Manager and then right-click on the
required web. On selecting Properties, the properties
dialog box opens up. In the Directories tab, on clicking
Configuration , we go to a dialog where there is a tab
on ASP debugging. This needs to be clicked ( a check box ) to enable
server-side debugging.

Once this is done, we can go to the code, type in
stop ( for VBScript ) where we want the breakpoint and
start up the site. The script debugger will be opened up at the
appropriate point and we can debug. One important thing, the
debugging option should be disabled after we are done.

I hope this article will enable you to start debugging your
ASP/Web applications. Of course once you have installed the Script
Debugger, help files come with it to facilitate more advanced use.

Comments! Questions! Mail
Me

Latest Posts

Related Stories