The debugger cannot be used with other browsers.
NOTE: When you're stopped in Netscape JavaScript Debugger, you cannot use many features of Communicator. In particular, you cannot use Navigator to browse web pages. For this reason, it is recommended that you download the PDF version of this document before starting the debugger. You can then either print that document or view it online with Acrobat Reader.What's in this document:
[your Communicator install directory]\Program\JSDebug\JSDebugger.htmlHere,
[your Communicator install directory]
is the directory in which Communicator is installed. For example, if you installed it in c:\Program Files\Netscape\Communicator\
, then the start page for Netscape JavaScript Debugger would be:
c:\Program Files\Netscape\Communicator\Program\JSDebug\JSDebugger.htmlOn other platforms, that page is:
[your Communicator install directory]\JSDebug\JSDebugger.htmlFor future convenience, the first time you use the debugger, you should add the
JSDebugger.html
page to your bookmarks or to your personal toolbar in Navigator.
NOTE: Several security dialog boxes are displayed the first time you run the debugger. You must grant the security privileges the debugger requests in order for it to function correctly.
Figure 1 JavaScript debugger window.
Menu Bar and Toolbar
The menu bar and the toolbar give you two ways to access the debugger's commands. Most of the items that occur on menus also occur on the toolbar. Where applicable, the instructions in this document tell you how to use the toolbar and the individual panes to access the debugger's functionality. You can also choose menu items for these tasks. When there is no button for a task, the menu item is described.
Source View Windows
The JavaScript debugger creates a separate Source View window for each HTML page you open in the debugger. (See "Opening a page to debug" for information on how you can open a page.)
Each Source View window contains the source of an HTML page. When execution stops in the debugger, the Source View window containing the currently executing HTML page is brought to the surface. Source View windows use colors and icons in the left margin to indicate the following information:
Important If the Call Stack is not empty, that is, if you are stopped in the debugger, you cannot use many features of Communicator. For example, while stopped in the debugger you cannot open a page in Navigator.
true
, then the interpreter activates the debugger. If the expression returns any value other than true
, the interpreter does not activate the debugger.
As you select items in the Source View, the state of the BrkPt button changes.
true
. This means "always stop". You can enter any JavaScript expression as the condition.true
.
NOTE: The condition expression must literally evaluate totrue
. If it evaluates to anything else (such as 0,false
, 1, or"Success"
), the interpreter does not activate the debugger.
x
is either greater than or equal to 5 or its value is -1
:x >= 5 || x == -1
document.URL == "http://warp/index.html"
(java.lang.System.out.println("myFunction called with x = " + x)) && falseWith this condition, the debugger always prints to the console, but does not stop since the entire expression returns false. A similar situation would be to log information every time the code is executed but activate the debugger only if the value of
prop.lengt
h is 5. To do so, use this expression:
(java.lang.System.out.println("myFunction called with x = " + x)), prop.length == 5You can also use a conditional breakpoint to change values at runtime. Consider the following expression:
(x == -1) && (x = 0) && falseWhen the interpreter executes the line of code that contains that condition, it first checks to see if the value of
x
is -1. If so, it sets the value of x
to 0. The interpreter does not stop for this condition, since it always returns false
.
Figure 2 The Watches window.
To add a new watch
You can add a new watch to the list in two ways, depending on whether or not you want to copy text from a Source View window as part of the new watch expression.
To add text from a Source View window:
Last Updated: 07/31/97 09:05:13