<div id="foobar">
....
</div>
Ben
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 :(
> --
> You received this message because you are subscribed to the Google Groups "greasemonkey-users" group.
> To post to this group, send email to greasemon...@googlegroups.com.
> To unsubscribe from this group, send email to greasemonkey-us...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/greasemonkey-users?hl=en.
>
--
--
ℱin del ℳensaje.
jQuery is indeed nice, in combination with Greasemonkey I only ran into
problems with one site that was using $ for another library and had
scripts active while Greasemonkey kicked in, and before I could undo
jQuery's taking over $. The workaround for that was a patched jQuery
library that doesn't set $ and voilà, works there too.
--
Klaus Johannes Rusch
klaus...@atmedia.net
http://klausrusch.atmedia.net/
Try this:
var elem = document.getElementById("foobar");
elem.parentNode.removeChild(elem);
--
Michal Wojciechowski
http://odyniec.net/ | http://userscripts.org/users/49673
> Is this JQuery code or does it require any other library to load in advance?
>
> Or can I simply put your code into a GM *.user.js script?
It's plain DOM code, so it does not require any libraries. You can put
it in your script as it is.
Much better:
document.getElementById('foobar').style.display = 'none';