1

请参考下面的html代码

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
        <title></title>
        <script src="Scripts/jquery-2.0.0.min.js"></script>
 </head>
<body>
<div id="container"></div>
</body>
</html>

当我在 IE7 浏览器中打开这个 html 页面时,它会抛出类似“ JSON”未定义的错误,如果在 IE8 浏览器中打开同样的错误意味着它会抛出类似“对象不支持属性或方法'addEventListener'

我该如何解决这个问题?

谢谢,

湿婆

4

2 回答 2

2

jQuery 2 不支持 IE 8 和更早版本。如果您想支持这些浏览器,请使用(仍受支持的)jQuery 1.x 分支。

http://jquery.com/browser-support/

于 2013-08-13T07:14:51.443 回答
1

您应该只对不支持的Jquery 2.0使用Jquery 1.9 版本IE 6,7,8older versionsIE

As promised, this version leaves behind the older Internet Explorer 6, 7, and 8 browsers. In return it is smaller, faster, and can be used in JavaScript environments where the code needed for old-IE compatibility often causes problems of its own. 不过不用担心,jQuery 团队仍然支持在 IE 6/7/8 上运行的 1.x 分支You can (and should) continue to use jQuery 1.9 (and the upcoming 1.10) on web sites that need to accommodate older browsers.

阅读jquery-2-0-released

于 2013-08-13T07:17:12.013 回答