When Unpoly inserts a fragment, the [up-source]
attribute is automatically set
to the URL from which the fragment's HTML was loaded.
When an element is reloaded or polled,
Unpoly will request the URL from the closest [up-source]
attribute.
The [up-source]
attribute is only set for GET
requests.
To indicate a different source URL for a fragment (and its descendants),
manually set [up-source]
attribute:
<div class="unread-count" up-poll up-source="/unread-count"> <!-- mark: up-source -->
2 new messages
</div>
When such an [up-source]
attribute is explicitly set in the HTML, Unpoly will not overwrite
it on insertion.
To retrieve the source URL from JavaScript, use up.fragment.source()
.
The URL from which this element and its descendants were initially requested.