Namespace: loadElement

just.loadElement(tagNamenon-null, propertiesopt, containeropt, listeneropt) → {Element|*}

Loads an external file if no other similar element is found.
Source:
just.js, line 1104

Parameters:

NameTypeDefaultDescription
tagName
element_tagA tag name.
properties
[optional]
url or objectThe url of the file or the properties for the new element.
container
[optional]
Node or just.loadElement~handlerdocument.headA custom function to append the element by yourself or a Node to append the created element to it.
listener
[optional]
just.loadElement~listenerA function to trigger on element load/error.

Throws:

document.createElement exception or TypeError if url is missing.

Returns:

The created element, a similar element, or the returned value of handler.
Type
Element or Any

Type Definitions

handler(loadedElementnullable, url) → {*}

A custom function to append the created element.
Source:
just.js, line 1076
This:

{!Element}

Parameters:
NameTypeDescription
loadedElement
[nullable]
ElementAn identical element that has been loaded previously.
url
urlThe given url to load.
Returns:
Some value.
Type
Any

listener(eventnon-null) → {*}

A listener for the "onload" or "onerror" events.
Source:
just.js, line 1066
This:

Element

Parameters:
NameTypeDescription
event
EventThe triggered event.
Returns:
Type
Any