No luck, which is really odd as I can't see any reason that wouldn't
work. Not even a javascript error when the button is pushed. I might
just need to break down and look inside the greasemonkey plugin to see
exactly what it's doing with the userscript files before passing it on
to mozjs. A little beyond my level, but might be worth a shot.

On Jun 8, 11:56 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Not sure this will work, but worth a try:
>
> > * greasemonkey init code + The main jquery lib code*
>
> $('<input type="button" name="popupButton" value="popUp">').prependTo
> ('body').click(function() {
>     alert("Popup from userscript function!");
>
> });
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Jun 8, 2007, at 12:34 PM, emerson999 wrote:
>
>
>
> > I've been trying to use jquery within a greasemonkey script, and keep
> > hitting the same problem. Both from a simple copy and paste of jquery
> > into a greasemonkey script, and using the version of jquery modified
> > for greasemonkey over athttp://userscripts.org/scripts/show/7373,
> > there's one problem which will come up.
>
> > Adding or changing something on a page works fine, except that it
> > won't seem to add javascript functions. For example, the code below
>
> > * greasemonkey init code + The main jquery lib code*
>
> > function AlertBox()
> > {
> >     alert("Popup from userscript function!")
> > }
>
> > $("body").prepend( $("<input type='button' name='popupButton'
> > value='popUp' onclick='AlertBox()'>") );
>
> > This will create the button, but there will be no effect from clicking
> > it, other than an error message on the console warning of a missing
> > AlertBox function,  and a view source will show no AlertBox function
> > in the page source.
>
> > Any ideas on what might be going wrong here, or if there's a way to
> > get it working? I've tried the same code as a konqueror userscript,
> > and everything runs perfectly.

Reply via email to