Using jQuery plugins in greasemonkey (i.e. tipsy)
greasemonkey, javascript, jquery, jquery-plugins
Solution
I think it's because inside Greasemonkey, jQuery has a different default context than the document. Try this:
$("#login", document).find('a:first').tipsy();
Problem
I'm trying (and for the most part succeeding) to use the tipsy jQuery plugin in my greasemonkey script. I am using the @require meta tag to import the jquery and tipsy js, and it works, but with a couple caveats which I'm trying to overcome. Accessing elements as a pure jQuery object fails, so I'm relegated to using DOM functions to get my elements: ``` //this fails $('#login').find('a:first').tipsy(); //while this succeeds $(document.getElementById('login').getElementsByTagName('a')[0]).tipsy(); ``` Anyone know why? Need more info? TIA!