This topic describes common tasks you might want to perform when you are
developing HTML5 applications. For
more detailed information, click the links in the right column.
| To perform this task |
Follow these steps |
| Create a project. |
- Choose File > New Project (Ctrl-Shift-N) in the main menu.
- Select the correct project template in the
New Project wizard.
- Step through the wizard to specify a site template option and add JavaScript files.
|
| Add a JavaScript library to a project. |
- In the Projects window, right-click the project node and
choose Properties.
- Select the JavaScript Files category in the Project Properties window.
- Select the JavaScript file from the list in the left pane and click the right arrow button
to move the selected file to the list in the right pane. Click OK.
|
| Specify the target browser. |
- Select the project node in the Projects window.
- Select the browser from the dropdown list in the Toolbar.
Alternatively, right-click the project node and choose Properties
in the popup menu and then select a browser from the dropdown list
in the Run panel of the Project Properties window.
|
| Inspect source code with the browser. |
- Specify Chrome with NetBeans Integration as the target browser and install the NetBeans extension for Chrome.
Alternatively, you can specify Embedded WebKit Browser.
- Run the project.
- Enable Inspect in NetBeans Mode.
|
| View the application in various screen sizes. |
- Specify either Chrome with NetBeans Integration or Embedded WebKit Browser as the target browser.
- Run the project.
- In the browser, select a screen size or create
a custom screen size.
|
| Run a project. |
- Specify a target browser for the application.
- Right-click the project node in the Projects window and choose Run.
|
| Debug a JavaScript file. |
- Specify either Chrome with NetBeans Integration or Embedded WebKit Browser as the target browser.
- Set the breakpoints in the JavaScript file.
- Right-click the project node and choose Run.
Alternatively, right-click the HTML file that invokes the JavaScript
file and choose Run File.
|
| Test a JavaScript file. |
- In the Services window, right-click the JS Test Driver node and choose Configure.
- Configure JS Test Driver by specify the location of the JS Test Driver JAR
and specifying the browsers that you would like to test the JavaScript against.
- Create a jsTest Driver Configuration File by choosing File > New File and selecting jsTest Driver Configuration File in the Unit Tests category.
- Create the JavaScript file and add the unit tests to the file.
- Edit the jsTest Driver configuration file to load the JavaScript files and the test files.
- Right-click the project node and choose Test.
|