Thats not a very good way to do it IMO, since other libraries like Prototype
use the $ function. I would check for unsafeWindow.jQuery, since all jquery
pages should have that set.

On 3/24/07, SeViR <[EMAIL PROTECTED]> wrote:

This is a simple GreaseMonkey user script file to get jQuery version of
any website.

The script add a new menu option in Firefox > Tools > GreasyMonkey >
Commands > JQVersion

I don't need any firefox addon if I can make it ;-P

---- getjqueryversion.user.js -----
// ==UserScript==
// @name           GetjQueryVersion
// @namespace      http://www.jquery.com/
// @description    Get jQuery Version
// @include        *
// ==/UserScript==


(function(){
GM_registerMenuCommand("JQVersion",     function(e){
        try {
            jQ = unsafeWindow.$;
            alert("This page uses JQuery version "+jQ().jquery);
        } catch(err) {
            alert("No JQuery!");
        }

    }
);
}
)()

------ end of getjqueryversion.user.js ----------

Jason Levine escribió:
> Ok, this isn't a plugin request but it is related to JQuery.
>
> Occasionally I wonder whether a site is using JQuery to make their cool
> effects.  I made a bookmarklet to quickly try to access the JQuery
object on
> the page and return either the JQuery version or a no JQuery in use
message.
>
> Here's the bookmarklet:
>
> javascript:(function() { try { alert("This page uses JQuery version "+
> $().jquery); } catch(err) { alert("No JQuery!"); } } )()
>
> Now for the request, I would love to see this packaged into a FireFox
> plugin.  I envision an unobtrusive item on the status bar that either
says
> that the current page isn't using JQuery or shows the JQuery version
being
> used on the page.  This way you could check sites during your normal web
> browsing.
>
> Anyone out there skilled in Firefox Extension authoring want to take
this
> on?
>
> -Jason
>


--
Best Regards,
José Francisco Rives Lirola <sevir1ATgmail.com>

SeViR CW · Computer Design
http://www.sevir.org

Murcia - Spain


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to