如何确定和打印jQuery版本?
有没有一个jQuery函数返回当前加载的jQuery的版本?
你可以使用这个:
 $.fn.jquery //or if you're using .noConflict(): jQuery.fn.jquery 
当jQuery被构build时它会自动更新,在这里定义: http : //github.com/jquery/jquery/blob/master/src/core.js#L174
 确保使用$.fn.property属性不依赖于一个对象,没有理由创build一个不需要的jquery对象与$().property除非你打算使用它:) 
 alert( $.fn.jquery ) 
 $().jquery; // yields the string "1.4.2", for example 
资料来源: http : //jquery-howto.blogspot.com/2009/02/how-to-check-jquery-version.html
 $().jquery; 
这将返回一个包含jQuery版本的string
 我不知道有多less版本的jQuery存在,但一个jQuery对象有一个存储版本的jquery属性。 
 alert( $().jquery ); 
 如果您使用的是该版本,将会提示1.4.2 。 
尝试
 alert($().jquery) 
警报是好的,但如果你想实际上打印jQuery版本…
 <script> document.write($.fn.jquery); </script>