Is there a jQuery function that returns the version of jQuery loaded?
You can use this:
$.fn.jquery //or if you're using .noConflict(): jQuery.fn.jquery
It automatically updates when building jQuery defined here: http://github.com/jquery/jquery/blob/master/src/core.js#L174
Be sure to use $.fn.property for properties that are independent of the object, there is no reason to create an unnecessary jquery object using $().property Property if you are not going to use it :)
$.fn.property
$().property
alert( $.fn.jquery )
$().jquery; // yields the string "1.4.2", for example
Source: http://jquery-howto.blogspot.com/2009/02/how-to-check-jquery-version.html
$().jquery;
This will return a string containing the jQuery version
I'm not sure how many versions of jQuery exist, but the jQuery object has a jquery property that stores the version.
jquery
alert( $().jquery );
Will warn 1.4.2 if you use this version.
1.4.2
to try
alert($().jquery)
The warning is good, but if you want to actually print the jquery version ...
<script> document.write($.fn.jquery); </script>