Add JavaScript

If you want to add your own CSS assets or JavaScript assets, you should have experience of this. If they are added incorrectly, it may affect the webpage.
JavaScript
Name
Give your asset a name. One tip is to write as clear a name as possible, because it is the name that will appear in the list of JavaScript assets.
Source
Designate a js file or enter the address of a JavaScript source.
By default, the file archive is displayed where you browse for the correct file. To specify an address instead, select to change the link type to External page.

Use in edit mode
Whether the assets should be printed/rendered in the editor or not.
Compress
Compressing JavaScript assets is turned on automatically. If for some reason you do not want to compress your assets, untick this box.
The Compress option is only available on templates.
Help with scripts is not included in the support agreement.
Async
When selecting Async, the script tagging gets an async attribute. If you select async, you cannot select defer.
Defer
When you select Defer, the script tagging gets a defer attribute. If you select defer, you cannot select async.
Read more about deferring script loading at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
SRI (Applies only to external sources)
Here you can ensure that the external file is the file it claims to be and has not been manipulated afterwards.
Integrity
Here you enter the checksum you received from the issuer of the file.
Crossorigin
There are two options here: Anonymous and User credentials. The default is "Anonymous."
You can read more about SRI on our developer site: https://developer.sitevision.se/edit/5.3e4afb49181dc6850791f8
This function requires you to have "Manage developer functions" permission.
The page published:
help.sitevision.se always refers to the latest version of Sitevision
Print page