JavaScript Properties
The JavaScript Properties dialog appears when you right-click a JavaScript file on the Resources pane and select Properties. (See also: Using JavaScript.)
It contains three options:
- Name: This option lets you rename the JavaScript resource in the template. The link between the JavaScript file and Web sections that include it will not be broken by renaming the file. (See also: Including a JavaScript file in a Web context.)
- Async: When async is checked, the script executes asynchronously with the rest of the page (while the page continues the parsing).
- Defer: This option postpones the execution of the script until the page has finished parsing. This is required by APIs like Google Maps.
It is recommended to check at least one of the options: async or defer, or both. Page content will become visible more quickly, resulting in a better user experience.
If you enable both options, async takes precedence on modern browsers, while older browsers that support defer but not async will fallback to defer.
When neither of the options is checked, the script gets fetched and executed immediately, interrupting the page loading and rendering.