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.

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.

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.

  1. Open the HTML file in the editor.
  2. Open the Navigator window, if not already open.
  3. In the Navigator window, locate the object in the DOM tree that you want to debug.
  4. 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.

  1. Open the JavaScript file in the editor.
  2. Click in the left margin of the editor next to the line where you want to set the breakpoint.

    The breakpoint icon (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.

  1. Open a JavaScript file or HTML file in the editor.
  2. Place the insert cursor in the file and choose Debug > New Breakpoint in the main menu to open the New Breakpoint dialog box.
  3. Select JavaScript in the Debugger dropdown list and select Event in the Breakpoint Type dropdown list.
  4. 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.

  1. Open a JavaScript file or HTML file in the editor.
  2. Place the insert cursor in the file and choose Debug > New Breakpoint in the main menu to open the New Breakpoint dialog box.
  3. Select JavaScript in the Debugger dropdown list and select XMLHttpRequest in the Breakpoint Type dropdown list.
  4. Specify the URL. Click OK.
See Also
About Debugging JavaScript Files
Integrating an HTML5 Project with a Browser

Legal Notices