jQuery IE 中的“JSON”未定义问题但不是 chrome

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10219398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 08:58:00  来源:igfitidea点击:

'JSON' is undefined' issue in IE but not chrome

jqueryajaxjsoninternet-explorer

提问by OBL

I am getting the following error with my jquery ajax call in IE9, where I am using Json.stringify().

我在 IE9 中使用 jquery ajax 调用时出现以下错误,其中我使用的是 Json.stringify()。

Microsoft JScript runtime error: 'JSON' is undefined

Microsoft JScript 运行时错误:“JSON”未定义

The same function was working for me till yesterday and still works on my colleagues machine and on chrome on my machine. But for no apparent reason has stopped working on my machine today.

直到昨天,同样的功能对我有用,并且仍然适用于我的同事机器和我机器上的 chrome。但是今天没有明显的原因停止在我的机器上工作。

May you please help me understand, what is causing it?

请您帮我理解一下,是什么原因造成的?

Thanks!

谢谢!

回答by Tony

the solution for me was to turn OFF compatibility mode by clicking the "torn page" icon to the right of the address bar.

我的解决方案是通过单击地址栏右侧的“撕裂页面”图标来关闭兼容模式。

Who knows how it got turned on in the first place!

谁知道它是如何被打开的!

回答by g13n