Edit this page

up.script up.script.config
JavaScript property

Configures defaults for script handling.


[config.assetSelectors] optional

An array of CSS selectors matching default assets.

By default all remote scripts and stylesheets in the <head> are considered assets. Inline scripts and internal styles are not tracked by default, but you can include them with an [up-asset] attribute.

Unpoly only tracks assets in the <head>. Elements in the <body> are never tracked, even if they match one of the configured selectors.

See Tracking assets for examples.

[config.noAssetSelectors] optional

Exceptions to up.script.config.assetSelectors.

Matching elements will not be considered assets even if they match up.script.config.assetSelectors.

[config.scriptSelectors] optional experimental

An array of CSS selectors matching elements that run JavaScript.

By default this matches all <script> tags.

Matching elements will be removed from new page fragments with up.fragment.config.runScripts = false.

This configuration does not affect what Unpoly considers an assets. For this configure up.script.config.assetSelectors.

[config.noScriptSelectors] optional experimental

Exceptions to up.script.config.scriptSelectors.