The up.script
package lets you pair HTML elements with JavaScript behavior.
Unpoly encourages you to migrate all your custom JavaScript from DOMContentLoaded
callbacks to compilers. This will make sure they run both at page load and
when a new fragment is inserted later. See Migrating legacy JavaScripts
for details.
Registers a function to be called when an element with the given selector is inserted into the DOM.
Attaches structured data to an element, to be consumed by a compiler or event handler.
Registers a compiler that is run before all other compilers.
Manually compiles a page fragment that has been inserted into the DOM by external code.
Tracks an element as a frontend asset, usually JavaScripts and stylesheets.
This event is emitted when frontend code changes while the application is running.
Registers a function to be called when an element with the given selector is inserted into the DOM.
Registers a function to be called when an element with the given selector is inserted into the DOM. The function is called with each matching element as a jQuery object.
Returns the data attached to the given element.
Attaches structured data to an element, to be consumed by a compiler or event handler.
Registers a function to be called when the given element is destroyed.
Manually compiles a page fragment that has been inserted into the DOM by external code.
Registers a compiler that is run before all other compilers.
Registers a compiler that is run before all other compilers. The compiler function is called with each matching element as a jQuery object.
Configures defaults for script handling.