Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Greasemonkey

Name: Anonymous 2010-01-02 14:53

Hey /prog/
I need some help with greasemonkey scripting.
this is what I got:

var ad = document.getElementById('ad_left');
ad.parentNode.removeChild(ad);

It should work, but doesn't. What's wrong?

Name: Anonymous 2010-01-02 14:59

I don't know anything about greasemonkey, but I'll tell you that "doesn't work" isn't enough information for people to understand your problem.  Good luck.

Name: Anonymous 2010-01-02 15:01

YEah, though Debugging 2 lines of javascript is kind of weird. I'm a beginner.

Name: Anonymous 2010-01-02 15:09

Try the error console in FF

Name: Anonymous 2010-01-02 15:15

I haven't done Javascript in years, but did you actually check that the ID was 'ad_left'. You may have mixed it up with class or some other attribute.

Name: Anonymous 2010-01-02 15:32

Experimented a little. It seems that it only works sometimes. Werid. I can remove the google logo on the front page but nothing on the results page.

Name: Anonymous 2010-01-02 15:34

Apparently 'ad' is null. Could it be because the script looks for ad_left before the page has loaded?

Name: Anonymous 2010-01-02 16:00

GREASE ME ANUS

Name: Anonymous 2010-01-02 16:25

Try mixing an onLoad event into this somehow.

Name: Anonymous 2010-01-02 16:48

Use [code]setInterval[code] to fire you're routine every millisecond, it'll eventually work.

Name: Anonymous 2010-01-02 17:03

var ad;
while((ad = document.getElementById('ad_left')) != null) {}
ad.parentNode.removeChild(ad);


How badly could this fail?

Name: Anonymous 2010-01-02 17:04

>>11
Answer: badly, if I forget my == from my != so easily.  Grumble, grumble

Name: Anonymous 2010-01-02 18:22

>>12
yeah… that was pretty bad.

and that fucking retarded script-hanging loop is the reason GodSussman invented Events.

Name: Anonymous 2010-01-02 18:35

>>13
Screw Events.  Javascript doesn't deserve them.

Name: Anonymous 2010-01-02 22:37

javascript has lamdbas, can't you just register this to onload with jquery?

Name: ​​​​​​​​​​ 2010-09-08 21:11


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List