assets
javascript
resources
Developer
Jahia 7.3
Jahia 8
Legacy
How to add asynchronous resources?
Question
Is it possible to add ressources in a asynchronous way as the below script tag?
<script src="script.js" async></script>
Answer
To add resources, you can choose the tag <template:addRessources>
The list of attributes, for a javascript type, are the following ones:
resources
: The list of resources they will be included in the defined order.targetTag
: The target tag where the link will be insertedcondition
: optional HTML browser condition (ex : if > IE 6)insert
: If set to true the resource is inserted at the top of the resources list. Otherwise, it is appended to the end.title
: An optional title value for this asset (in case of a link).key
: key for managing uniqueness of inline type.var
: Name of the exportedpageContext
variable to hold the value specified in the action.async
: available from Jahia 7.3.1.1defer
: available from Jahia 7.3.1.1