HTML Script

Due to the risk of breaking your page with these macros, they are disabled by default when the HAT plugin is installed. The administrator has to enable them manually in the Add-on Manager.

Description

The HTML Script macro places a <script> tag on your page.

There are two flavors of this macro:

  • HTML Script: Has a body expected to be the script to be executed.

  • HTML Script (External): Has a no body but allows a URL to an external script.

These macros require good knowledge of Javascript and HTML in order to know what you do when you add them.

Adding the Macro

  1. Edit your page.

  2. Select “+” => Other macros

  3. Type in “html” in the Search box

  4. Select the “HTML Script” or “HTML Script (External)” macro

Macro Options: HTML Script

Type

Specify the script type here, e.g. “text/javascript”. Leave this field empty if you are not sure.

Macro Options: HTML Script (External)

Asynchronous Execution

Select whether the script shall be executed asynchronously.

  • If selected: The script is executed asynchronously with the rest of the page (the script will be executed as soon as it is loaded and while the rest of the page loads)

  • If not selected: The script is executed when the page has finished loading

Character Set

Enter the character set of the external script, e.g. “UTF-8”. Leave this field empty if you are not sure.

Deferred Execution

Select whether the script shall be executed deferred, in the sequence of other defer scripts of the page..

  • If selected: The script is executed asynchronously with the rest of the page (the script will be executed as soon as it is loaded and while the rest of the page loads, but in the sequence that other defer scripts are placed on the page)

  • If not selected: The script is executed when the page has finished loading (in the sequence other defer scripts are placed on the page)

Source

Enter the full URL of the external script.

Type

Specify the script type here, e.g. “text/javascript”. Leave this field empty if you are not sure.

Be Aware

The scripts, external or not, will be executed each time you load the page or edit the page. Additionally, the scripts will also be executed in the preview area when you edit the macro.

Last updated