Class MozileResource
Object
|
+--MozileResource
-
Direct Known Subclasses:
-
MozileScriptResource, MozileLinkResource, MozileStyleResource
- class
MozileResource
Defined in core.js
Constructor Summary |
MozileResource
(<String> category, <String> id, <String> type, <String> namespace)
Mozile Resource -
An abstract class for external resources, such as JavaScripts and CSS files.
|
Method Summary |
Element
|
createElement()
Creates a new element for the resource and returns it.
|
String
|
getCategory()
|
TextNode
|
getContent()
|
String
|
getElement()
Gets element associated with the resource.
|
String
|
getId()
|
String
|
getNamespace()
|
String
|
getType()
|
Void
|
load()
Inserts the resource's element into the document
|
TextNode
|
setContent(<String> content)
|
String
|
toString()
Returns "[object MozileResource]".
|
Boolean
|
unload(<Element> element)
Removes the resource's element from the document.
|
MozileResource
MozileResource(<String> category, <String> id, <String> type, <String> namespace)
Mozile Resource -
An abstract class for external resources, such as JavaScripts and CSS files.
You can give the resource's element text content with the setContent(content) method. For mocre complex content, first createElement() then manipulate the returned element.
Parameters:
category
- The category of the resource, used as the localName of the resource's element.
id
- The id for the resource, used as the id of the resources' element.
type
- Optional. The type for the resource, used for the type attribute. E.g. "text/css".
namespace
- Optional. The namespace for the resource's element. Defaults to the global XHTMLNS.
createElement
Element createElement()
Creates a new element for the resource and returns it.
getCategory
String getCategory()
Returns:
The category of resource.
getContent
TextNode getContent()
Returns:
The content of the resource (a node).
getElement
String getElement()
Gets element associated with the resource. Creates the element if necessary.
getId
String getId()
getNamespace
String getNamespace()
getType
String getType()
load
Void load()
Inserts the resource's element into the document
setContent
TextNode setContent(<String> content)
Parameters:
content
- Creates a text node which will be appended to the element.
Returns:
The content of the resource.
toString
String toString()
Returns "[object MozileResource]".
unload
Boolean unload(<Element> element)
Removes the resource's element from the document.
Parameters:
element
- Optional. If an element is provided the resource's element will be removed from the given element.
Returns:
True if any elements have been removed. False otherwise.
Documentation generated by
JSDoc on Wed Mar 15 11:59:24 2006