Re: wich better with removechild childnodes haschildnodes



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
.



Relevant Pages

  • Re: Safari cant handle non-anonymous type schemes
    ... If you are using Integrated Windows Authentication - only IE supports that ... (it is a proprietary Microsoft authentication system). ... Other browsers support Basic, and I believe newer browsers support Digest. ...
    (microsoft.public.inetserver.iis.security)
  • Re: getElementbyId Firefox v IE
    ... The DOM equivalent to IE's innerText property is textContent. ... Since it's part of DOM 3, not all browsers support it but newer Gecko browsers ...
    (comp.lang.javascript)
  • Re: Fonts and FrontPage
    ... > think only MSIE browsers at best. ... > that font you're using. ... > 3) Absolute positioning is not a good idea, since few browsers support it, ...
    (microsoft.public.frontpage.client)
  • Re: How can i use Javascript to make the way to identify the correct user browser
    ... display according to the users. ... You can look at what browsers support what features and test for those. ...
    (comp.lang.javascript)