About Debugging JavaScript Files
See Also
You can use the IDE to debug JavaScript files in HTML5 applications.
JavaScript debugging starts automatically when you run the application or
unit tests in one of the browsers that support debugging.
When you are debugging the application the following windows provide debugging details.
- Breakpoints window. Displays a list of breakpoints in all open applications.
- Call Stack window. Displays the current execution stack of a JavaScript program.
- Variables window. Displays the variables that are valid in the current scope.
- Browser Log. Displays the exceptions, errors and warnings that are generated by the browser.
When you run the application the debugger will pause execution of the application at
the first breakpoint in the JavaScript that is encountered and the
JavaScript file that contains the breakpoint opens in the editor.
The IDE also automatically opens the JavaScript debugger windows.
You can use the debugging buttons in the toolbar to step through the JavaScript files.
Browsers that Support Debugging
To debug JavaScript files in the IDE the
IDE needs to be able to communicate with the debugger.
To use the JavaScript debugger in the IDE you need to
select one of the following browser options as the target browser.
- Embedded WebKit Browser.
The IDE includes a browser that is based on WebKit. The embedded WebKit
browser enables you to view and debug HTML5 applications in the IDE.
If you select Embedded WebKit Browser as the browser in the Project Properties window
the IDE will open the browser in a window in the IDE when you run the application
and debugging is automatically enabled.
- Chrome with NetBeans Integration.
The IDE includes an extension that you can install in
the Chrome browser that enables the IDE and the browser to communicate.
If you select Chrome with NetBeans Integration as the browser in the Properties window
the IDE will open the Chrome browser when you run the application.
Debugging is automatically enabled if the extension is
installed when you run the application.
If the extension is not installed the IDE will prompt you to install the extension.
You can select the target browser for the application in the Browser dropdown list in the toolbar.
Alternatively, you can select the browser in the Run category of the Project Properties window.
- See Also
- Setting JavaScript Breakpoints
- Integrating an HTML5 Project with a Browser
Legal Notices