just.load(tagNamenon-null, propertiesopt, containeropt, listeneropt) → {Element|*}
Loads an external file if no other similar element is found.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
| tagName | element_tag | A tag name. | |
| properties [optional] | url or object | The url of the file or the properties for the new element. | |
| container [optional] | Node or just.loadElement~handler | document.head | A custom function to append the element by yourself or a Node to append the created element to it. |
| listener [optional] | just.loadElement~listener | A 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
