Hey Zmitro,

If the element has no parent (which means it is not part of the document
tree), how do you expect Element#remove() to work then? In my opinion, an
error is what *should* happen in this case:

  var div = new Element()
  div.remove()

Are you suggesting it should silently fail? I don't agree with that, it
leads to hard-to-debug scenarios for users.

- Mislav

On Jan 25, 2008 4:38 PM, Zmitro Lapcjonak <[EMAIL PROTECTED]> wrote:

>
> Hi.
>
> The remove function texts:
>
> Element.Methods = {
> ...
>  remove: function(element) {
>   element = $(element);
>   element.parentNode.removeChild(element);
>   return element;
> },
> ...
>
> This code fails when element.parentNode == null
>
> I use prototype v 1.6
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to