Namespace: loadElement

just.loadElement(tagnon-null, urlnon-null, handleropt, listeneropt) → {*}

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

Parameters:

Name Type Default Description
tag
element_tag A tag name.
url
url The url of the file.
handler
[optional]
just.loadElement~handler appendToHead If it's a function: it will be triggered (without appending the element), otherwise: the element will be appended to head.
listener
[optional]
just.loadElement~listener A function to trigger after the element is appended.
Throws:
document.createElement exception or TypeError if url is missing.
Returns:
The return of the handler.
Type
Any

Members

nonSrcAttributes :Object.<element_tag, just.loadElement~srcLikeAttribute>

Element-tags that are known for not using 'src' to fetch a url.
Source:
core.js, line 1054
Type:

Object.<element_tag, just.loadElement~srcLikeAttribute>

Type Definitions

handler(loadedElementnullable, url) → {*}

A custom function to append the created element.
Source:
core.js, line 955
This:

{!Element}

Parameters:
Name Type Description
loadedElement
[nullable]
Element An identical element that has been loaded previously.
url
url The given url to load.
Returns:
Some value.
Type
Any

listener(eventnon-null) → {*}

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

Element

Parameters:
Name Type Description
event
Event The triggered event.
Returns:
Type
Any

srcLikeAttribute

An src-like attribute for an Element.
Source:
core.js, line 1039
Type:

string