Jquery插件在IE 8中出现错误

Jquery plugin giving error in IE 8

本文关键字:错误 插件 IE Jquery      更新时间:2023-09-26

我在JQUERY中有一个功能,它需要jquery的基本插件才能工作。

在不同的浏览器中测试时,我发现我的插件在IE中作为出现错误

对象不支持此属性或方法

而相同的插件在CHROME中正常工作。

插件是

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

看看小提琴,它在CHROME中运行良好,但在IE中运行不好。

return H||(H=n.Deferred() 线上

所以我想要一个插件,它支持我在IE 8和chrome中的功能。

JQuery 2.x版本不支持IE8

要在legecy浏览器中使用JQuery,您需要从JQuery下载页面下载1.x版本:http://jquery.com/download/

或者,如果您使用的是Google托管的库,请选择1.x代码段。

当前的最新版本是:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>

对IE 8使用回退方法,因为它不支持jquery 2+

<!--[if (!IE)|(gt IE 8)]><!-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<!--<![endif]-->
<!--[if lte IE 8]>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<![endif]-->