This pattern is used for referencing custom JavaScript files.
...
How this works
Include custom JavaScript
...
Yes - Indicates that custom JavaScript will be used.
Info |
---|
Selecting this option causes the JavaScript reference group to be displayed. |
No - Indicates that custom JavaScript will not be used.
JS reference
...
This group contains all the fields necessary for defining a reference to a single JavaScript file.
Info |
---|
You can define multiple JavaScript references by using the Add new group button to the right of the group label. |
Type
...
Asset - Indicates the JavaScript file is located in Cascade as a part of your site.
Info |
---|
Selecting this option causes the File field to display. |
URL - Indicates the JavaScript file exists somewhere on the web.
Info |
---|
Selecting this option causes the URL, Crossorigin handling, and Integrity fields to display. |
File
Note |
---|
Only displayed when Type is set to ‘Asset’. |
...
Use the asset chooser to select the desired JavaScript file in your Cascade site.
URL
Note |
---|
Only displayed when Type is set to ‘URL’. |
...
Enter the full URL of the CSS file in the URL text field.
Placement
...
Indicates where in the html document the JavaScript file reference will be placed.
<head> - The JavaScript reference will be included in the html document head.
<body> - The JavaScript reference will be included at the end of the html document body.
Execution option
...
Default - Has not affect.
defer - Sets the defer attribute on the script reference.
async - Sets the async attribute on the script reference.
Crossorigin handling and Integrity
Note |
---|
Only displayed when Type is set to ‘URL’. |
...
Some websites also provide integrity and crossorigin attribute values with their hosted files.
Code Block |
---|
<script .... crossorgin=”....” integrity=”....”></script> |
Use the Crossorigin handling and Integrity fields to provide the respective values.