getting started with greasemonkey. I have don't some js programming
in the past, but mostly back around 2002-2005 and pretty exclusively
in IE. Anyway, I am working on adding some elements to a site as
well as a button which I hope to allow me to launch a js function.
The function will be part of my greasemonkey script and will be
attached to a new div I create and add to the page. I am able to get
the div added to the page and use the registerEvent method(and tried a
few other things), but so far, I am unable to get my button to fire
any events, no matter what I try.
Right now, I just have a test function as a stub:
function registerEvents()
{
var link = document.getElementById("send");
if(link != null)
{
alert(link.innerHTML );
link.addEventListener('click', doNothing, false);
doNothing();
alert(link );
}
}
function doNothing()
{
alert("right now, this does nothing");
}
my registerEvents() does fire, the alerts show correctly, doNothing()
fires correctly, but when I click on the div where the event should
be... nothing happens, like there is no event attached. Please help!!!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---