[Greasemonkey] Basic JavaScript questions
chris feldmann
cfeldmann at gmail.com
Thu Jun 30 11:24:02 EDT 2005
I'd like to note that while the XPath function in my working script above
may seem a little hairy at first glance, it behooves you to imprint that
basic query template in your script-writing brain because I think you will
find it an invaluable tool. And as an aside, for future reference, I don't
think anything within the document is strictly "read only;" the DOM's pretty
much your playground. And you might want to edit your @description. Have
fun!
On 6/30/05, The Chris Method <thechrisproject at gmail.com> wrote:
>
> Okay, here's what I have so far:
> http://thechrisproject.com/code/overheardclean.user.js
>
> Lemme know what you think.
>
> On 6/30/05, The Chris Method <thechrisproject at gmail.com> wrote:
> >
> > Thanks for all the replies. I see a couple of things:
> > 1) My understanding of what how a "read-only array" (the NodeList) acts
> > was wrong. It makes much more sense now. I think the best way to remove the
> > elements would be the while loop that always removed the first element in
> > the NodeList.
> >
> > 2) Using the css looks way cleaner, and I'm gonna try that. I'll
> > probably be back with more questions.
> >
> > Thanks again everyone for your help.
> >
> > On 6/29/05, Lenny Domnitser < ldrhcp at gmail.com> wrote:
> > >
> > > Just keep killing the first one.
> > >
> > > var headings = document.getElementsByTagName('h3');
> > > while(headings.length) {
> > > var heading = headings[0];
> > > heading.parentNode.removeChild(heading);
> > > }
> > > _______________________________________________
> > > Greasemonkey mailing list
> > > Greasemonkey at mozdev.org
> > > http://mozdev.org/mailman/listinfo/greasemonkey
> > >
> >
> >
>
> _______________________________________________
> Greasemonkey mailing list
> Greasemonkey at mozdev.org
> http://mozdev.org/mailman/listinfo/greasemonkey
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050630/f31e91d7/attachment.htm
More information about the Greasemonkey
mailing list