Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

This pattern is used for referencing custom JavaScript files.

custom js data definition in its default state

How this works

Include custom JavaScript

include custom javascript data definition field

Yes - Indicates that custom JavaScript will be used.

Selecting this option causes the JavaScript reference group to be displayed.

No - Indicates that custom JavaScript will not be used.

JS reference

js reference data definition group

This group contains all the fields necessary for defining a reference to a single JavaScript file.

Need more than one JS reference? You can create additional groups to fit your needs.

Type

type data definition field

Asset - Indicates the JavaScript file is located in Cascade as a part of your site.

Selecting this option causes the File field to display.

URL - Indicates the JavaScript file exists somewhere on the web.

Selecting this option causes the URL, Crossorigin handling, and Integrity fields to display.

File

Only displayed when Type is set to ‘Asset’.

file data definition field

Use the asset chooser to select the desired JavaScript file in your Cascade site.

URL

Only displayed when Type is set to ‘URL’.

url data definition field

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

execution option data definition field

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

Only displayed when Type is set to ‘URL’.

crossorigin handling and integrity data definition fields

Some websites also provide integrity and crossorigin attribute values with their hosted files.

<script .... crossorgin=”....” integrity=”....”></script>

Use the Crossorigin handling and Integrity fields to provide the respective values.

  • No labels