Running an HTML5 Application
See Also
An HTML5 application project is typically run in a browser on your desktop or a mobile device.
When you run an HTML5 application on your local system for testing or debugging
you do not need to compile or deploy the application to a server because the JavaScript engine in the browser
generally handles any scripts in the application.
To run the application you only need to specify the browser and then run the application.
Specifying the browser
When you want to run an HTML5 application or file from the IDE you need to specify
the target browser. The IDE enables you to easily select any of the browsers that
are installed on your local system or you can select the embedded WebKit browser.
You can specify the target browser for the application in the following ways.
- Select the application in the Projects window and then select the browser from the dropdown list in the Toolbar.
- Open the Project Properties window and select the browser in the Run panel of the window.
- If you want to debug an HTML5 application or file, or synchronize the IDE with your browser to inspect
your code, you should select either Chrome with NetBeans Integration or Embedded WebKit Browser
as the target browser.
Running an application
After you specify the browser, you can run the application in the following ways.
- Right-click the project node in the Projects window and choose Run in the popup menu.
- Select the application in the Projects window and then click Run in the Toolbar
or choose Run > Run Project (F6) in the main menu.
When you run an application the IDE opens the application in the selected browser.
You can run an application using the internal web server or specify an external server.
You can set the web server in the Run category in the Project Properties window of the project.
- If more than one project is open you can specify one of the projects as the Main Project.
After you specify the project as the Main Project, the F6 keyboard shortcut
will always run the Main Project regardless of the project that is selected in the Projects window.
Running a file
You can run an HTML file in an HTML5 application in the following ways.
- Right-click the HTML file in the Projects window and choose Run File from the popup menu (Shift-F6).
- If the HTML file is open in the editor, you can right-click in the file and choose Run File (Shift-F6)
from the popup menu or click the Run File button in the Selection tab of the CSS Styles window.
When you run a file the IDE opens the file in the target browser for the application.
- See Also
- Debugging an HTML5 Application Project
- Integrating an HTML5 Project with the Browser
- Inspecting HTML5 Code with the Browser
- Changing Browser Screen Sizes
Legal Notices