W3C home > Mailing lists > Public > www-dom@w3.org > October to December 1998

Re: An observation about "live" NodeLists

From: Mark Robinson <markr@sites-online.com>
Date: Fri, 16 Oct 1998 21:58:46 -0400
Message-ID: <3627F9D6.DD5EA9E2@sites-online.com>
To: "Stephen R. Savitzky" <steve@crc.ricoh.com>
CC: www-dom@w3.org
Steve -

> ...The _correct_ way of deleting all the paragraphs in a document is, of course, 
> to replace line 3 with:
> 
> 3'  for (int i = numberOfParagraphs - 1; i >= 0; i--) {

or just not deal with the indexing at all, like:

      Node n = nl.item(0);
      while( n != null )
      {  n.getParentNode().removeChild(n);
         n = nl.item(0);
      }

Right?

Mark Robinson
Received on Friday, 16 October 1998 22:00:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:45 GMT