Edit this page

up.element up.element.jsonAttr(element, attribute)
JavaScript function

Reads the given attribute from the element, parsed as JSON.

Returns undefined if the attribute value is blank.

Throws a SyntaxError if the attribute value is an invalid JSON string.


Parameters

element Element

The element from which to retrieve the attribute value.

attribute string

The attribute name.

Return value

The cast attribute value.