Loading Modules with AUI Script

The aui:script tag is a JSP tag that loads JavaScript on the page, while ensuring that certain resources are loaded before executing.

The aui:script tag supports the following options:

OptionDescription
requireRequires an AMD module to load with the Liferay AMD Module Loader.
useUses an AlloyUI/YUI module that is loaded via the YUI loader.
positionThe position the script tag is put on the page. Possible options are inline or auto.
sandboxWhether to wrap the script tag in an anonymous function. If set to true, in addition to the wrapping, $ and _ are defined for jQuery and underscore.

This section covers how to load ES2015, Metal.js, and AUI modules with the AUI script tag.

« Using External JavaScript LibrariesLoading AlloyUI Modules with AUI Script »
この記事は役に立ちましたか?
1人中0人がこの記事が役に立ったと言っています