[Greasemonkey] Execute onClick event, without clicking it

mmccarthy at reifysoft.com mmccarthy at reifysoft.com
Thu Jul 28 15:12:11 EDT 2005


You can execute someElement.onclick() yourself.

 

Also, you can simulate an actual click with the click() method in IE.  For
Mozilla, you can add the click() method to the HTML element prototype, as
seen at http://www.peterbailey.net/nm/source.php (search for
"prototype.click = function").

 

Matt McCarthy

When I am king, you will be first against the wall 

With your opinion, which is of no consequence at all. 

-Radiohead, "Paranoid Android" 

 

  _____  

From: greasemonkey-bounces at mozdev.org
[mailto:greasemonkey-bounces at mozdev.org] On Behalf Of Brendan Crosser-McGay
Sent: Thursday, July 28, 2005 12:29 PM
To: greasemonkey at mozdev.org
Subject: [Greasemonkey] Execute onClick event, without clicking it

 

I'm writing something similar to the slashdot "tree" comment system script,
for the forums here:
http://www.carnageblender.com/bboard/, I have made something that gives me a
toggle button for each thread.  Which was no easy feat considering the forum
has two different "visual" modes it can be in, one without tables, and just
using blockquotes, and one using fancy tables and avatars for everything.

My question is that I want to be able to run through each and every span
tag, and execute the onclick event in that tag using a loop.  Yes I'm being
a bit lazy, since I don't want to make an entirely new loop to go through
and do all the work of toggling each thread, I'm hoping that the JS I've
already injected into each thread can do that work for me.  Is this
possible?

-Brendan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/greasemonkey/attachments/20050728/96d39579/attachment.htm


More information about the Greasemonkey mailing list