问题标签 [jquery-2.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1527 浏览

jquery - jQuery 2.0 放弃了对 IE6/7/8 的支持,那么 1.x 分支会维持多久呢?

jQuery 2.0 刚刚发布,完全放弃了对 Internet Explorer 6、7 和 8 [更多... ] 的支持。目前 [2013 年 4 月] 1.9.x 分支仍在维护中,可能会得到一些改进和错误修复 [1.10 即将到来!],但肯定不会太久。jQuery 宣布可以在同一页面上使用 2.0 和 1.9,但迟早会放弃这个分支。

凭借 6-7% 的全球市场份额 [更多... ],在某些国家甚至 50%(中国等 [更多... ]),IE8/7/6 组仍然是网络上的一件大事,并且许多大型老派公司仍在内部使用它们,没有更新的计划。现实情况是:即使在 2015 年,IE6/7/8 用户也将在经济上达到可观的数量[根据燃尽计算]。而经常听到的“让我们放弃那些用户”的说法并不好,在专业的公司环境中,没有销售人员会同意这一点,即使用户的百分比是0.5%!遗憾的是,IE8/7 在 2013 年、2014 年和 2015 年对许多前端开发人员来说仍然很重要,因为主要与来自亚洲等地的客户一起工作的人可能会更长(!)。

所以我的问题是:是否有官方声明显示 jQuery 1.x 分支的长期服务路线图?

注意:我询问了官方的 jQuery 团队,但还没有得到答案。

0 投票
4 回答
1869 浏览

jquery - jQuery live() works with jQuery 1.8.3 & below but not with 1.9.1 or 2.0

I've been using http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js for a while now and everything has been fine, but 1.8.3 got quite old so I've decided to move to the latest jQuery. And suddenly a few things stopped working: Quicksand plugin and part of my own jQuery code (that shows additional data under every slide of a slider).

Can you help me figuring out what's wrong? Or maybe it's not worth moving to jQuery versions above 1.8.3? Check the Jsfiddle.

HTML:

JS:

CSS:

Here's a working jsfiddle: http://jsfiddle.net/ABrna/

Try changing jQuery to 1.9.1 or 2.0 and hit Run. Script stops working. Why?

0 投票
2 回答
387 浏览

jquery - 与 jquery 同步排列多个效果

是否有更易读的方式来对同步执行的一些异步效果进行排队?

0 投票
1 回答
290 浏览

javascript - Ajax.ActionLink 生成的 ASP.NET 代码在升级到 JQuery 2.0.1 后停止工作

我有一个已升级到 JQuery 2.0.1 的 ASP.NET MVC3 应用程序,不幸的是这产生了一些令人不快的副作用。(更多信息在这里

目前我只有一个突出的问题:@Ajax.ActionLink 生成的 HTML 链接不再调用相应的 js 代码,而是被浏览器视为常规链接。

有问题的页面包含以下 js 文件:

我不得不手动更新jquery.unobtrusive-ajax.min.js文件以解决另一个问题(替换liveon)。

Ajax.ActionLink外观如下:

生成的 HTML 看起来不错:

任何人都可以建议哪些 js 文件以及我需要如何修改才能使此链接再次正常工作?

0 投票
1 回答
803 浏览

javascript - JSON 在 IE8 中未声明错误

我无法弄清楚如何摆脱在 IE8 及更早版本中运行我的应用程序时收到的一系列错误。jquery.mi.js 脚本中显示的第一个错误:“未声明 JSON”。显然,由于 JSON 没有首先声明,因此会弹出“未指定对象”或“未声明 $”等其他错误。IE9 和 10 与所有其他浏览器一样完美地运行该应用程序。

jquery.min.js 脚本首先加载,您可以在以下 index.html 标头中看到:

我想指出,我看到很多关于类似问题的帖子和讨论,但他们的解决方案/建议似乎都不适用于我的情况。

非常感谢你的想法,Jacek

将 jquery 版本更改为 1.10.1 后编辑:

这是现在导致错误的ajax调用:

};

0 投票
1 回答
2325 浏览

asp.net-mvc-4 - Internet Explorer 8.0 中 JQuery-2.0.2.js 中未处理的异常

我有一个 ASP.NET MVC 4.0 应用程序,它使用多个调用多个 ajax 请求。此后,我更新了几个 NuGet 包,其中 jQuery 就是其中之一,并且已更新到 2.0.2 版。

自更新以来,我在 jquery-2.0.2.js 中遇到了以下行的问题

扔一个

当应用程序在 VS2012 中以调试模式运行时。该问题仅出现在 Internet Explorer 8 中。我已经验证它在 Opera、Opera Mobile Emulator、Chrome 和 Firefox 中运行。

我正在通过 BundleConfig 加载 CSS 和脚本,看起来像这样

并且在我看来是这样加载的

IE (v8.0?) 和 jquery 2.0.2 之间有问题吗?或者有没有其他人遇到过这个可能有修复的问题?

谢谢!

安迪

0 投票
2 回答
2098 浏览

jquery - 在 IE8 中使用 ASP.NET 捆绑检查 jQuery 失败

我有一个使用 jQuery 2.0+ 的网站,如果尚未加载 jQuery,我想执行一个操作。本质上,我正在检查任何不支持 jQuery 2 的浏览器,例如 IE8、7、6 等。

我在 jquery.check.js 中这样做

BundleConfig 正在像这样进行捆绑:

当在debug="true"代码上工作得很好。当转向false它不起作用。在使用 IE8 进行调试时,该if语句永远不会到达,并且存在一堆错误。

听起来 IE8 在发生错误时会停止执行 JavaScript 文件,因此永远不会到达代码块。这是我能想出的唯一原因,为什么它在debug="true"(文件单独加载)时有效,而在捆绑时无效(一个文件)。

我的推理正确吗?

0 投票
6 回答
2430 浏览

jquery - jquery提交表单和查询字符串问题

我在表单页面的查询字符串上有一些值。当我使用提交按钮提交表单时,我可以获得查询字符串值,但是当我使用 jquery 提交表单时,如下所示。我不再看到查询字符串值。我在搞砸什么吗?

链接是这样的:

html代码如下:

我再也看不到服务器上的令牌了。当我使用 jquery 提交表单时。我正在使用 mvc 4 和 jquery 2.0.0

0 投票
2 回答
11797 浏览

jquery - Detecting browsers that are not supported by jQuery (2)

Forgive me if there is an obvious answer to this question, but I haven't been able to find it. I am considering switching over to jQuery 2 and, although I'm not concerned about supporting older browsers, I would like to be able to tell users with unsupported browsers that they can't use the site.

I see here (http://blog.jquery.com/2013/03/01/jquery-2-0-beta-2-released/) that you can use conditional comments to branch .js files on different versions of IE, but I believe jQuery 2.0 drops support for a number of other browsers too, not just IE, so I don't think that would do it alone [edit: this is wrong, see larger edit below].

In an ideal world, I'd switch to jQuery 2 and then have a single javascript function that is called when jQuery tells me that it doesn't support the browser. Is there a straightforward way of doing this that I'm missing?

Thanks.

EDIT:

I came across this post (http://bugs.jquery.com/ticket/13404) which directed me here: http://jquery.com/browser-support/. It turns out that, in terms of support, jQuery 2 only differs from jQuery 1.9 on IE browsers. Accordingly, perhaps a better question to ask is how to detect browsers that are not supported by jQuery (in general, not just version 2) - I have updated the question title.

EDIT2:

As feature detection is the most recommended approach to this issue, the jQuery support method looks relevant here (http://api.jquery.com/jQuery.support/). However, it also seems quite iffy to rely on (as it can change without notice).

I suppose this creates the key question. How am I supposed to have any idea what jQuery features are or are not subject to potential non-support from old browsers? For instance, if someone comes to the site with a 4-version-old copy of Firefox, I wouldn't have any idea what features I'd need to test for. It would be ace if jQuery could offer some sort of fully-supported feature test, like this for HTML5: http://html5test.com/

EDIT3:

Okay, so with the conditional include statements (highlighted in answers below, and on jQuery's site), you can deal with old versions of IE. However, for other browsers, it's a little tricky. Since you cannot rely on jQuery to tell you anything about the browser's support for function x, y, or z, my approach is simply to query the underlying javascript. If you want to query CSS-based support, you can use modernizr. For javascript-based support, this is the method I use to detect SUPER old versions of other browsers:

AFAICT, this function should eliminate all browsers that could give jQuery trouble for its basic functionality. If you want to do anything fancy, then there's probably a specific piece of functionality that you know you require, so you can check for it specifically.

0 投票
2 回答
7769 浏览

jquery - Twitter Bootstrap 和 jQuery 2.0 兼容性

twitter bootstrap 2.3.X 或 3.0.0-wip 是否与 jQuery 2.x 兼容?

如果没有,未来有升级兼容性的打算吗?