在Internet Explorer 7和8中,“JSON”和“jQuery”仍未定义 [英] 'JSON' and 'jQuery' still undefined in Internet Explorer 7 and 8

查看:120
本文介绍了在Internet Explorer 7和8中,“JSON”和“jQuery”仍未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在< head> 标签之间包含了这三个受欢迎的脚本

I got these three popular scripts included between my <head> tags

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/json3/3.2.6/json3.min.js"></script>
<script type="text/javascript" src="/js/jquery.cookie.js"></script>

当我在IE7和8中检查错误时,我得到以下信息:

When I check for errors in IE7 and 8 I get the following:


  1. 'JSON'未定义。 (IE7)

  2. 'jQuery'未定义。 (IE7和IE8)

  3. 对象不支持此属性或方法。 (IE8)

任何人都可以告诉我这是什么原因,因为我显然是在我的页面上包括那些,但仍然来未定义。除了这些内容之外,我的页面上还没有其他内容。

Can anybody tell me what is the cause of this, because I clearly am including those on my page, yet still come up as undefined. I have nothing else yet on my page besides these includes.

我该如何解决这个问题?

How can I fix this?

推荐答案

jQuery 2.0 放弃支持适用于IE 6,7和8,仅适用于您不需要支持这些浏览器的情况。对于大多数人来说,正确的解决方案是使用jQuery 1.x,这仍​​然是官方支持的:

jQuery 2.0 drops support for IE 6, 7 and 8, and is only meant for when you know you don't need to support those browsers. For most people the correct solution is to use jQuery 1.x instead, which is still officially supported:

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

这篇关于在Internet Explorer 7和8中,“JSON”和“jQuery”仍未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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