如何在不使用JQuery的情况下找出我正在使用的JQuery版本? [英] How can I find out what JQuery version I'm using WITHOUT using JQuery?

查看:82
本文介绍了如何在不使用JQuery的情况下找出我正在使用的JQuery版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的页面中添加了一个jQuery文件。有什么方法可以找到调用哪个版本的jQuery?

In my page a jQuery file is added. Is there any way to find which version of jQuery is called?

如果可以使用mootools或纯JavaScript来处理它会很好,因为我不知道jQuery。

It would be nice if this can be handled using mootools or plain JavaScript because I don't know jQuery.

编辑:让我从以下答案中得出结论。如果您只想要jQuery版本,可以使用

Let me conclude from the below answers. If you just want the jQuery version, you can use

$().jquery; or $.fn.jquery

如果你不擅长jQuery,你可以定义一个变量并使用以下代码段:

If you are not good in jQuery you can define a variable and use the following code snippet:

var jVersion;
jVersion = window.jQuery.fn.jquery;


推荐答案

您可以使用 $ ()。jquery; $。fn.jquery

这将返回一个包含版本号的字符串,例如1.6.2。

Which will return a string containing the version number, e.g. 1.6.2.

这篇关于如何在不使用JQuery的情况下找出我正在使用的JQuery版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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