Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check what version of jQuery is loaded?

Tags:

jquery

How do I check which version of jQuery is loaded on the client machine? The client may have jQuery loaded but I don't know how to check it. If they have it loaded how do I check the version and the prefix such as:

$('.class') JQuery('.class') 
like image 822
Luke101 Avatar asked Aug 07 '11 16:08

Luke101


People also ask

How do I check if jQuery is loaded?

You can just type window. jQuery in Console . If it return a function(e,n) ... Then it is confirmed that the jquery is loaded and working successfully.

What version of jQuery ui do I have console?

You can use $. ui. version , it's actually the property jQuery UI looks for when determining if it should load itself (if it's already there, abort).

What version of jQuery should I use?

Because going jQuery free is generally better for performance and security - it is recommended to either not use jQuery, or use the latest version available. For older websites, it's not as simple. Removing jQuery can break existing old code on the website.


1 Answers

if (typeof jQuery != 'undefined') {       // jQuery is loaded => print the version     alert(jQuery.fn.jquery); } 
like image 92
Darin Dimitrov Avatar answered Oct 31 '22 01:10

Darin Dimitrov