Setting JavaScript Breakpoints
See Also
To debug the JavaScript in your application in the IDE you need to specify
breakpoints that will pause execution of the scripts when they are hit.
You can set the following JavaScript breakpoints in the IDE.
- DOM. Use this breakpoint to debug changes
that are made to the DOM tree.
- Line. Use this breakpoint to debug specific
lines of code in your JavaScript file.
- Event. Use this breakpoint to debug actions
in your application that are invoked by events.
- XMLHttpRequest. Use this breakpoint to debug
requests for URLs.
The steps for setting JavaScript breakpoints will depend upon
the type of breakpoint.
You can open the New Breakpoint dialog box in the following ways.
- Choose Debug > New Breakpoint from the main menu.
- Open the Breakpoints window and click the New Breakpoint icon
(
) in the left margin.
Setting DOM Breakpoints
You set DOM breakpoints by selecting a DOM node in the Navigator window
and then specifying the changes that will trigger the DOM breakpoint.
- Open the HTML file in the editor.
- Open the Navigator window, if not already open.
- In the Navigator window, locate the object in the DOM tree that you want to debug.
- Right-click the object and choose one of the DOM breakpoint properties in the popup menu.
Setting Line Breakpoints
You set line breakpoints by setting a breakpoint in the line in
the JavaScript file that you want to debug.
- Open the JavaScript file in the editor.
- Click in the left margin of the editor next to the line where you want to set the breakpoint.
The breakpoint icon (
)
will appear in the margin.
Setting Events Breakpoints
You set events breakpoints by specifying the actions in the application that
will trigger the breakpoint.
- Open a JavaScript file or HTML file in the editor.
- Place the insert cursor in the file and choose Debug > New Breakpoint in the main menu to open
the New Breakpoint dialog box.
- Select JavaScript in the Debugger dropdown list and select Event in the Breakpoint Type dropdown list.
- Select any actions that you want to trigger the breakpoint.
Click OK.
Setting XMLHttpRequest Breakpoints
You set XMLHttpRequest breakpoints by specifying a URL
that will trigger the breakpoint when it is requested by a script.
- Open a JavaScript file or HTML file in the editor.
- Place the insert cursor in the file and choose Debug > New Breakpoint in the main menu to open
the New Breakpoint dialog box.
- Select JavaScript in the Debugger dropdown list and select XMLHttpRequest in the Breakpoint Type dropdown list.
- Specify the URL.
Click OK.
- See Also
- About Debugging JavaScript Files
- Integrating an HTML5 Project with a Browser
Legal Notices