Edit this page

up.fragment up:fragment:inserted
DOM event

When a page fragment has been inserted or updated, this event is emitted on the new element.

When an element with children is inserted, up:fragment:inserted is only emitted once for the entire new subtree.

If you're looking to run code when a new fragment matches a selector, use up.compiler().
This event is emitted after compilation.

Render lifecycle

Example

up.on('up:fragment:inserted', function(event, fragment) {
  console.log("Looks like we have a new %o!", fragment)
})

Event properties

event.target
required

The fragment that has been inserted or updated.

event.layer
required

The layer of the new fragment.

event.ok
required

Whether the element was loaded from a successful response.

boolean
event.revalidating
required

Whether the element was reloaded for the purpose of cache revalidation.

boolean