Configures defaults for fragment updates.
An array of CSS selectors matching default render targets.
When no other render target is given, Unpoly will update the first selector matching both the current page and the server response.
When navigating to a main target, Unpoly will automatically reset scroll positions and update the browser history.
This property is aliased as up.layer.config.any.mainTargets
.
An array of class names that should be ignored when deriving a target selector from a fragment.
The class names may also be passed as a regular expression.
An object of default options to apply when navigating.
Whether to match an existing fragment around the triggered link.
If set to false
Unpoly will replace the first fragment
matching the given target selector in the link's layer.
When an updated fragments contain an element matching one of the given CSS selectors, history will be updated with { history: 'auto' }
.
By default Unpoly will auto-update history when updating a main target.
How to scroll after updating a fragment with { scroll: 'auto' }
.
See scroll option for a list of allowed values.
The default configuration tries, in this order:
#hash
, scroll to the hash.How to focus when updating a fragment with { focus: 'auto' }
.
See focus option for a list of allowed values.
The default configuration tries, in this order:
#hash
in the URL.[autofocus]
element in the new fragment.Whether to execute <script>
tags in updated fragments.
Scripts will load asynchronously, with no guarantee of execution order.
If you set this to true
, mind that the <body>
element is a default
main target. If you are including your global application scripts
at the end of your <body>
for performance reasons, swapping the <body>
will re-execute these scripts.
In that case you must configure a different main target that does not include
your application scripts.