Namespace: load

just.load(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