Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/397.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用最新jquery版本时,JSON是未定义的错误_Javascript_Jquery_Html_Internet Explorer - Fatal编程技术网

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

Javascript 使用最新jquery版本时,JSON是未定义的错误,javascript,jquery,html,internet-explorer,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

请参考下面的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”

我如何解决这个问题

谢谢


Siva

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


-

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

正如所承诺的那样,这个版本抛弃了旧的Internet Explorer 6、7和8浏览器。作为回报,它更小、更快,并且可以在JavaScript环境中使用,在JavaScript环境中,旧IE兼容性所需的代码常常会导致其自身的问题。
但是不要担心,jQuery团队仍然支持1.x分支,它不支持n在IE 6/7/8上
您可以(也应该)在需要容纳较旧浏览器的网站上继续使用jQuery 1.9(以及即将推出的1.10)。

阅读