Edit this page

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

Returns the URL from which the given element was loaded.

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.

Example

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

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

We can now ask for the source of an element:

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

Parameters

element
required

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

Elementstring

Return value

The URL from which the element was loaded.

stringundefined