insertBefore(newChild, refChild)




Download 2,96 Mb.
Pdf ko'rish
bet112/131
Sana14.05.2024
Hajmi2,96 Mb.
#232039
1   ...   108   109   110   111   112   113   114   115   ...   131
Bog'liq
Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

insertBefore(newChild, refChild)
Parameters
: newChild
 
and refChild
 
are both Nodes.
Return value
: Node
Exceptions thrown
: DOMException
Description
: This method inserts the node newChild before an existing child node 
refChild, and newChild is then returned. If refChild is set to null, then newChild is inserted 
at the end of the list of children. An error occurs if refChild does not exits or if newChild is 
not an allowable node to a given parent.
Comments
: Consult Figures 4.13 through 4.19 to see which nodes are allowed to be 
inserted. For example, if you try to insert a Document node into an Element’s list of 
children, an error is thrown. Please note that Attr nodes cannot be inserted into an 
Element’s child list using this method. Consult the methods found on the Element node 
for managing attributes.
replaceChild(newChild, oldChild)
Parameters
: newChild and oldChild
 
are both Nodes.
Return value
: Node
Exceptions thrown
: DOMException
Description
: oldChild is removed from the list of children, and newChild is inserted into its 
place. oldChild is then returned.


- 124 -
Comments
: Consult Figures 4.13 through 4.19 to see which nodes are allowed to be 
inserted.
removeChild(oldChild)
Parameters
: oldChild is a Node.
Return value
: None
Exceptions thrown
: DOMException
Description
: oldChild is removed from the list of children. If oldChild does not exist, then 
an error is raised.
Comments
: In Internet Explorer 5, oldChild is returned.

Download 2,96 Mb.
1   ...   108   109   110   111   112   113   114   115   ...   131




Download 2,96 Mb.
Pdf ko'rish