With JQuery is easy
$("#foobar").remove();
Withouth JQuery... you could, maybe, find the parent of the node, is
index, and make parent.childNode[index] = null; Side effect of this
is that deleting a huge tree this way is instant. Other option is to
use a function to delete all childrens with parent.removeChild ...
About JQuery,... hee... JQuery is a higuer level of abstraction that
pure Javascript. Is like a new programming language that compile to
javascript. By being a few orders of magniture more abstract than pure
javascript, solutions are easier to write, and the intention of the
code is obvious. The only downside is having to download this 200KB
library, but a greasemonkey will have that cached. I can't imagine
cases where somebody can't use JQuery, the other 99.99% of the
javascript programmers have not reason to use naked javascript. JQuery
is the new Javascript.
...And sorry about that, because this fact hurt these people that
don't want or can't use JQuery, and that make me sad :(
On 4 April 2012 09:35, Ben Stover <[email protected]> wrote:
> How can I delete a whole <div> pane with the following spec:
>
> <div id="foobar">
> ....
> </div>
>
> Ben
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "greasemonkey-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/greasemonkey-users?hl=en.
>
--
--
ℱin del ℳensaje.
--
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en.