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 swapped with a new version.