How to know jQuery version using Firebug console

This is a little tip for today: sometimes, you don’t have access to know what version of jQuery is loaded in a website or web application, so you can use the Firebug console to know what version is actually loaded. Just, type one of the next lines and you will obtain that data.

jquery-logo

Both major version version 1.x and version 2.x have a property called jQuery.fn.jquery, we could check it:

//  It returns something like: "1.9.1"
console.log(jQuery.fn.jquery);
// Of course we know jQuery == $, then we can use next shorthand syntax
console.log($.fn.jquery);

Also, we can  use an alternative syntax:

// Alternative syntax
console.log(jQuery().jquery);

// or shorthand method
console.log($().jquery);

That’s it!

Be happy with your code!

 

Añade un Comentario

Leave a Reply

Your email address will not be published. Required fields are marked *