Re: wich better with removechild childnodes haschildnodes
- From: RobG <rgqld@xxxxxxxxxxxx>
- Date: Sat, 30 Jun 2007 22:17:07 +1000
artev wrote:
are the same thing this two codes?
Yes, more or less.
or in the first there are (or will be) some deprecated parameters?
are both the codes, all browser compatible?
If browsers support one, they will likely support the other. I expect the second is faster, though you'd need a very large number of child nodes to see any difference.
If you are trying to remove the entire content of an element, consider:
tab.innerHTML = '';
or:
var tempNode = tab.cloneNode(false);
tab.parentNode.replaceChild(tempNode, tab);
which I think is fastest of all, but buggy on some older browsers.
--
Rob
"We shall not cease from exploration, and the end of all our
exploring will be to arrive where we started and know the
place for the first time." -- T. S. Eliot
.
- Follow-Ups:
- References:
- Prev by Date: wich better with removechild childnodes haschildnodes
- Next by Date: Re: wich better with removechild childnodes haschildnodes
- Previous by thread: wich better with removechild childnodes haschildnodes
- Next by thread: Re: wich better with removechild childnodes haschildnodes
- Index(es):
Relevant Pages
|