Edit this page

up.fragment up.fragment.source(element)
JavaScript function

Returns the URL the given element was retrieved from.

If the given element was never directly updated, but part of a larger fragment update, the closest known source of an ancestor element is returned.


In the HTML below, the element #one was loaded from the URL /foo:

<div id="one" up-source"/foo">
<div id="two">...</div>

We can now ask for the source of an element:

up.fragment.source('#two') // returns '/foo'


element Elementorstring

The element or CSS selector for which to look up the source URL.

Return value