How do you guys check if an element has been orphaned or not? I've
been using the parentNode method, but it only works when the element
itself has been removed, but not when the container holding a few
elements has been removed (understandably).

I know I could probably just use Element#up to check for the body
node, but that is an expensive query and I'm trying to make this as
native as possible.

At first I thought the built-in ownerDocument property would work, but
it doesn't seem to perform as I expect it to, which would be:

"The document that this node is in, or null if the node is not inside of one."

Short of using .up('body'), is there a native method of checking if an
element has been orphaned?

-justin

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

Reply via email to