JavaScript and Web Development

Obtain or Check Which jQuery Version

16 May 2012 - JavaScript, jQuery, Quick Tip - James Brown - No Comments

If you need to check which version of jQuery you are running (think Firebug or possibly), you can check the version using the following:

jQuery.fn.jquery

or use the shortcut

$.fn.jquery

Also, if you are loading multiple versions of jQuery on your page and need to verify, you can also use the property:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>

<script language='JavaScript'>
  var $_144 = jQuery.noConflict(true);
</script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>

<script language='JavaScript'>
 var $_171 = jQuery.noConflict(true);
  
  console.log($_144.fn.jquery);   //   "1.4.4"
  console.log($_171.fn.jquery);   //   "1.7.1"
</script>

Leave a Reply