Constructor
# new Resource(options)
A Resource class
Name | Type | Description |
---|---|---|
options |
Object | undefined |
- Since:
- 1.25.0
- Copyright:
- schukai GmbH
Classes
- Data
A Data Resource class
- Link
A Resource class
- Script
A Resource class
- Stylesheet
A Resource class
Members
# defaults
Properties
Name | Type | Description |
---|---|---|
document |
Document | the document object into which the node is to be appended |
src/href |
string | url to the corresponding resource |
query |
string | defines the location where the resource is to be hooked into the dom. |
id |
string | element attribute id |
title |
string | element attribute title |
class |
string | element attribute class |
timeout |
int | timeout |
Methods
# (static) getURLAttribute() → {string}
- Type
- string
# available() → {Promise}
With available()
you can check if a resource is available.
This is the case when the tag is included and the resource is loaded.
- Type
- Promise
# connect() → {Monster.DOM.Resource}
This method appends the HTMLElement to the specified document.
If the element has not yet been created, create()
is called implicitly.
throws {Error} target not found
- Type
- Monster.DOM.Resource
# create() → {Monster.DOM.Resource}
This method is overridden by the special classes and creates the DOM object.
This method is also called implicitly, if not yet done explicitly, by calling connect()
.
-
this method must be implemented by derived classes
- Type
- Error
- Type
- Monster.DOM.Resource
# isConnected() → {boolean}
- Type
- boolean