Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery version check

Tags:

jquery

I am trying to check the jquery version check. Tried the following commands in the console:

  1. jQuery. fn. jquery
  2. jQuery(). jquery

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.

like image 820
Pavan Ghantasala Avatar asked Apr 17 '19 07:04

Pavan Ghantasala


2 Answers

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)

like image 186
Chandan Kumar Avatar answered Oct 11 '22 15:10

Chandan Kumar


$().jquery will give you its version as a string.

Link source

sourse 2

For older versions of jQuery

jQuery().jquery  
jQuery().fn.jquery

For newer versions of jQuery

$().jquery
$().fn.jquery
like image 31
Chanaka Weerasinghe Avatar answered Oct 11 '22 15:10

Chanaka Weerasinghe