Specifications

243
CHAPTER 20
JavaScript Debugger Modules
A JavaScript Debugger module is an extensibility module that inserts special code into a
document so the code can interface with the JavaScript Debugger. The modules are located with
the Dreamweaver Program Files in the Configuration/Debugger subfolder. These modules insert
specific JavaScript and HTML into a working document to create a debug version of the
document the next time that the JavaScript Debugger runs. The debug version is simply a set of
temporary replicated files for the HTML document and each external JavaScript file, created by
Macromedia Dreamweaver MX and saved in the current working folder. The debug version of
the HTML file appears in the browser. The JavaScript that is inserted into the temporary files,
called instrumentation, communicates with the Dreamweaver JavaScript Debugger as the
JavaScript executes in the browser.
For information about JavaScript Debugger API Commands, see JavaScript debugger functions
on page 498.
How the JavaScript Debugger module works
Dreamweaver comes with two JavaScript Debugger modules, one for each supported browser,
Netscape Navigator and Microsoft Internet Explorer. To provide support for a different browser,
you must create a new module and use
dom.instrumentDocument and
dreamweaver.startDebugger to debug the document in that browser.
When you call
dom.instrumentDocument, the specified module receives callbacks as
Dreamweaver parses the JavaScript in the document. So, for example, you could create a
JavaScript Debugger module that inserts comments or records information about the JavaScript
code, instead of inserting debugging enhancements.
When
dom.instrumentDocument is called with a specific module, the following steps occur:
1 Dreamweaver calls getIncludeFiles() in the module. This function returns the list of files
that will be referenced from the HTML instrumentation code that is returned from
getHeadInstrument() and getBodyInstrument(), which are called in steps 13 and 14. The
include files can be any type of file, such as an external JavaScript file, JavaApplet, or ActiveX
control. All the files must be in the Configuration/Debugger subfolder with the module.
Dreamweaver will copy the include files to the directory that contains the file being debugged,
and then will delete the include files from that directory when Dreamweaver exits.
2 Next, the HTML document is scanned for script tags and event handlers. The code inside the
script tag, in an external JavaScript file or in an event handler, is called a block.
Note: An external JavaScript file is a file that is specified as the src attribute of a SCRIPT tag.
3 Dreamweaver parses script tags in the HEAD section first.