DOM.Insert
This provides the basis for a powerful way to insert arbitrary HTML into an arbitrary point in a DOM tree.
These are classes that are not instantiable, but instead provide a useful set of operations. (In Javascript terms, they do not provide a prototype member, so you cannot call new() upon them.)
This is the base class for the DOM.Insert.* hierarchy. It provides an intialize() method ithat does all the useful work, using attributes and methods provided by the inheriting class. This class is NOT instantiable directly!
The constructor takes two parameters:
This value will be passed to $() (from DOM.Utils).
This is the HTML that will be inserted in the proper place.
The constructor expects that any child class will implement the following attributes and methods:
This is an optional attribute. If set and if the element passed into the constructor provides the insertAdjacentHTML() method, it will use this value for the first parameter to that method.
This is an optional method.
If set,
it will be called if the adjacency option fails.
When called,
this.range will be set to this.element.ownerDocument.createRange()
This is a required method. If the adjacency option fails, this method will be called. It can assume that the following attributes will be set:
This is passed in from the constructor.
This is passed in from the constructor.
This will be set to this.element.ownerDocument.createRange()
This will be set to this.range.createContextualFragment(this.content)
This requires JSAN, Class, and DOM.Utils to be installed.
Currently, there is no mailing list or IRC channel. Please send bug reports and patches to the author.
Rob Kinyon (rob.kinyon@iinteractive.com)
Originally written by Sam Stephenson (sam@conio.net)
My time is generously donated by Infinity Interactive, Inc. http://www.iinteractive.com
Hey! The above document had some coding errors, which are explained below: