2022.1

Table Of Contents
Adding JavaScript files to the Resources
Adding a JavaScript file
To add a JavaScript file to the resources:
1. Add the file:
l Right-click the JavaScript folder on the Resources pane, and click New
JavaScript. Double-click it to open and edit it.
l Alternatively, drag and drop the JavaScript file from the Windows Explorer to the
JavaScript folder on the Resources pane.
l Or import one or more JavaScript files from another template; see "Import
Resources dialog" on page1029.
2. Make some settings for the file: right-click the file on the Resources pane and select
Properties.
l Defer postpones the execution of the script until the page in which it is included has
finished parsing. This attribute is required by APIs like Google Maps.
l When async is checked, the script executes asynchronously with the rest of the
page (while the page continues the parsing).
When neither option is checked, the script is fetched and executed immediately, while the
parsing of the page is paused.
Now the JavaScript file is ready to be used in your Web templates; see "Including a JavaScript
file in a Web context" on page600.
Adding a remote JavaScript file
A Remote JavaScript Resource is a file that is not located within your template but is hosted on
an external web server , generally called a CDN. Popular hosted frameworks on CDN networks
are:
l jQuery on MaxCDN
l Zurb Foundation on CDNJS
l Bootstrap on MaxCDN
l Multiple frameworks on Google Developers
When generating Web output, these files are referenced in the web page's header and are
served by the remote server, not by the Connect Server module.
Page 598