W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

range insertNode, what exception should be thrown?

From: Dylan Schiemann <dylans@yahoo.com>
Date: Wed, 30 May 2001 14:19:08 -0700 (PDT)
Message-ID: <20010530211908.12004.qmail@web13506.mail.yahoo.com>
To: www-dom@w3.org
Consider the following JavaScript syntax:

var x = document.createRange();
x.setStart(document.getElementsByTagName("p")[0],0);
x.setEnd(document.getElementsByTagName("p")[0],1);
x.insertNode(document.getElementsByTagName("div")[0]);

Suppose that the document does not contain any div
elements.  What exception should be thrown?  Do you
have to check for existence of the node before you
insert it?

Thanks,

Dylan Schiemann
http://www.sitepen.com/
http://www.dylanschiemann.com/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
Received on Wednesday, 30 May 2001 17:19:12 GMT

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