Reputation: 249
I am trying to check the jquery version check. Tried the following commands in the console:
but both are printing as "jquery" instead of version number. Please help me on this. The question might be a duplicate but none of them worked for me. so posting again.
Upvotes: 7
Views: 27698
Reputation: 775
if (typeof jQuery != 'undefined') {
// jQuery is loaded => print the version
alert(jQuery.fn.jquery);
}
It's work for me, try it
Upvotes: 0
Reputation: 31
Use this line of code in console of chrome dev tools
$.fn.jquery
This provides version of jQuery as a string
Upvotes: 0
Reputation: 5742
$().jquery
will give you its version as a string.
Link source
For older versions of jQuery
jQuery().jquery
jQuery().fn.jquery
For newer versions of jQuery
$().jquery
$().fn.jquery
Upvotes: 2
Reputation: 909
You can use either $().jquery; or $.fn.jquery which will return a string containing the version number, e.g. 1.6.2
or
Invoke console.log($()) and take note about jquery object fields
or
console.log('You are running jQuery version: ' + $.fn.jquery)
Upvotes: 5