|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defined in flavors.js
BrowserFlavor defines a version of XBLinJS for a conventional HTML browser. IE6 and Mozilla are tested, others are not but should probably go here.
It is possible that if cross-browser becomes too much to deal with, that we will actually create MozillaBrowserFlavor or IEFlavor, and dynamically select which flavor is the BrowserFlavor at runtime. Regardless, if you choose BrowserFlavor, you should get what you're looking for in your code.
Field Summary | |
Object |
flavorConstants
Browser constants |
Object |
flavorFixups
Browser fixups |
Constructor Summary | |
BrowserFlavor
()
BrowserFlavor - conventional browser flavor for XBLinJS |
Method Summary | |
void
|
attachHandlerToNode(node, event, handler)
Attach an event handler to a node |
Object
|
createElement(nodeType)
create an element |
Object
|
getAttributeFrom(node, key)
Gets an attribute from a node, be it Widget or DOM node |
Object
|
getElementsByTagName(tagName, node)
|
void
|
setAttributeOn(node, key, value)
Set an attribute on the node, be it Widget or DOM node |
Field Detail |
Object flavorConstants
The constants are:
These should of course be used sparingly, but it can be unavoidable at times.
Object flavorFixups
The fixups are:
Constructor Detail |
BrowserFlavor()
Method Detail |
void attachHandlerToNode(node, event, handler)
The Browser flavor attaches an event to a node by setting the attribute of the node directly, e.g. node.onclick = func.
Object createElement(nodeType)
In HTML mode, we assume DOM 1, which does not support namespaces via document.createElementNS. Create the node with document.createElement.
Object getAttributeFrom(node, key)
Like setAttributeOn, this flattens class and className to className, but it doesn't try to deal with style. Avoid retrieving style with this method, or take your lumps on IE.
Since it is possible for element[key] != element.getAttribute(key), this will try to use element[key], since that seems somewhat more reliable, but if that fails to come up with anything, will try element.getAttribute(key).
Object getElementsByTagName(tagName, node)
void setAttributeOn(node, key, value)
This generally uses both node[key] = value, and node.setAttribute(key, value), with the following exceptions:
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |