Hi guys, I'm totally new to greasemonkey, so if what I'm asking for is
simply impossible, or so simple that I should smack myself in the
face, I apologize in advance.

I'm working on a user script that enhances this browser based game
that I like.  I'm not the original author, I'm simply maintaining the
script as the game get updated, and trying to add new features.

Right now, on the page I'm trying to improve, there's this code:

<div onclick="commit_target(-1)" style="padding: 7px 2px 2px 313px;
height: 15px; width: 80px; cursor: pointer;">Click Here!</div>

What I'd like to do from my script is to add another button that calls
a function which loops through calling commit_target(-1) through
commit_target(-20).  I've been using trial and error to figure out how
the heck I actually call commit_target() from my script, and it's not
going well.  The script uses JQuery, so my code currently looks like
this:

var unAutoButton = document.createElement("div");
var buttonHtml = 'CLICK HERE!';
$(unAutoButton).html(buttonHtml);
$(unAutoButton).addClass("_unAutoButton");
$(unAutoButton).css("cursor", "pointer").css("padding", "5px 0px 0px
0px").css("text-align", "right").css("font-size", "175%").css("width",
"393px");

$(unAutoButton).click(function() {
        commit_target(-1);
        //alert("test");
        return false;
});

When I click my button, though, I get this in the Error Console:
"commit_target() is not defined."  I'm guessing that I'm simply using
the wrong syntax, but I have no idea what to search for in order to
learn the right syntax, so I'm asking here.  I hope you guys can
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.


Reply via email to