在代码中要提到的jQuery版本 [英] What jQuery version to mention in code

查看:70
本文介绍了在代码中要提到的jQuery版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是jQuery,我对页面开头包含的版本几乎没有什么困惑.根据我对其他软件的经验,我知道每个新版本都包含大多数旧功能,并提供了一些新功能.例如,如果最新的jQuery版本是1.9,为什么我会这样说:

I'm using jQuery, and I'm little confused about what version is included at start of my page. From my experience with other software I understand that each new version contains most old features, and offers some new ones. If latests jQuery version is 1.9 for example, why would I mention this:

<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../jqm145/jquery.mobile-1.4.5.min.css">
<script src="../jq1-11-3/jquery-1.11.3.js"></script>
<script src="../jqm145/jquery.mobile-1.4.5.min.js"></script>

如何检查某个函数是否可以在特定版本的Jquery中使用?

How do I check if a function will work in a specific version of Jquery?

此外,移动JQuery版本1.4.5和普通" JQuery是1.11.3.为什么会这样?

Furthermore, the mobile JQuery version 1.4.5 and "plain" JQuery is 1.11.3. Why is this the case?

推荐答案

这取决于您的目标受众,因此取决于您需要支持的浏览器. 您有三种选择:

It depends from your target audience, and therefore from the browsers you need to support. You have three options:

  1. 如果您需要支持Internet Explorer 6-8等较旧的浏览器, Opera 12.1x或Safari 5.1+,使用:jQuery 1.11.3 + jQuery Mobile 1.4.5
  2. 如果您需要当前稳定且使用最多的货币对,请使用:jQuery 2.1.4 + jQuery 移动版1.4.5
  3. 如果您生活在边缘,并希望积极参与 jQuery Mobile开发,在github上通知错误和未解决的问题, 用途:jQuery 3.2.1 + jQuery Mobile 1.5.0-alpha.1
  1. If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use: jQuery 1.11.3 + jQuery Mobile 1.4.5
  2. If you need the current stable and most used pair, use: jQuery 2.1.4 + jQuery Mobile 1.4.5
  3. If you are living on the edge, and would like to actively take part to the jQuery Mobile development, notify bugs and open issues on github, use: jQuery 3.2.1 + jQuery Mobile 1.5.0-alpha.1

这篇关于在代码中要提到的jQuery版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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