对象不支持jquery中的addEventListener IE8 [英] Object doesn't support addEventListener IE8 in jquery

查看:377
本文介绍了对象不支持jquery中的addEventListener IE8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Jquery 2.0.2,我在IE8中有错误:

I am using Jquery 2.0.2 and I have an error in IE8:


对象不支持属性或方法'addEventListener 'jquery.min.js,第4行字符6105

Object doesn't support property or method 'addEventListener' jquery.min.js, line 4 character 6105

除了ie8之外,我的所有代码都适用于chrome和firefox。

Somehow all my codes are fine with chrome and firefox, except for ie8.

获取这些错误还导致:


该属性的值'$ '是null或未定义,不是Function对象

The value of the property '$' is null or undefined, not a Function object

我将查询包含在我使用的其他js文件之上:

I included the query on top of other js files I have using:

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>

我知道Jquery2 +不支持IE8,但我不想使用较小版本的Jquery。

I know Jquery2+ doesnt support IE8, but I dont want to use a lesser version of Jquery.

推荐答案

jQuery 2.x已经不再支持IE< 9,所以如果你想支持IE7& 8然后使用最新版本的1.x分支 - 现在 1.11.0

jQuery 2.x has dropped support for IE < 9, so if you want to support IE7 & 8 then use latest version of 1.x branch - now 1.11.0

来自 jQuery


jQuery 2.x与jQuery 1.x具有相同的API,但不支持
Internet Explorer 6,7或8. jQuery 1.9升级
指南中的所有注释也适用于此处。由于IE 6/7/8仍然比较常见,我们建议使用
,除非您确定没有IE 6/7/8
用户访问该网站。

jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8. All the notes in the jQuery 1.9 Upgrade Guide apply here as well. Since IE 6/7/8 are still relatively common, we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site.

这篇关于对象不支持jquery中的addEventListener IE8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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