up.fragment.etag(element)

JavaScript function

Returns the ETag of the content in the given element.

The returned ETag corresponds to the ETag header in the response that rendered the fragment. Alternatively the [up-etag] attribute of the element or an ancestor is used.

If no ancestor fragment with an [up-etag] attribute exists, undefined is returned.

When the fragment is reloaded, its ETag is sent as an If-None-Match request header. The server may check the header and decide to skip rendering.


Parameters

element
required
Type: Element

Return value

The fragment's ETag.

Returns undefined if the fragment was rendered without an ETag.

Type: string | undefined