javascript - 使用最新的 jquery 版本时 JSON 是未定义的错误

标签 javascript jquery html internet-explorer

请引用下面的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'

我该如何解决这个问题?

谢谢,

湿婆

最佳答案

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

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

关于javascript - 使用最新的 jquery 版本时 JSON 是未定义的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18202842/

相关文章:

javascript - 无法使用 jQuery 按钮链接连接外部 HTML 文件

javascript - 根据上一页的用户输入,在页面加载时执行 JS 函数

javascript - 在 $.post() 回调中更新数据属性值后未更改

javascript - 淡入淡出 Bootstrap 3 模态

javascript - 仅选择一组中的一个复选框

javascript - 需要手动刷新页面才能显示登录的用户名

jquery - getJSON 到 console.log() 输出 json 结构

python - 将 html 表单值导入到 python 文件中

javascript - 使用 onclick 事件的响应式下拉菜单

javascript - 使用灵活框时,属性 <p></p> 不会换行