如何检查加载了哪个版本的jQuery? [英] How to check what version of jQuery is loaded?

查看:64
本文介绍了如何检查加载了哪个版本的jQuery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查客户端计算机上加载了哪个版本的jQuery?客户端可能已加载jQuery,但我不知道如何检查它.如果他们已加载它,如何检查版本和前缀,例如:

How do I check which version of jQuery is loaded on the client machine? The client may have jQuery loaded but I don't know how to check it. If they have it loaded how do I check the version and the prefix such as:

$('.class')
JQuery('.class')

推荐答案

if (typeof jQuery != 'undefined') {  
    // jQuery is loaded => print the version
    alert(jQuery.fn.jquery);
}

这篇关于如何检查加载了哪个版本的jQuery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆