“JSON”是Internet Explorer中JavaScript中未定义的错误 [英] 'JSON' is undefined error in JavaScript in Internet Explorer

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

问题描述

我们在我们的应用程序中使用jQuery。我们使用了一个jQuery插件来实现JavaScript会话。

We are using jQuery in our application. We have used a jQuery plugin to implement JavaScript session.

它在Firefox和大多数Internet Explorer 8浏览器中都能正常工作。

It is working properly in Firefox and most Internet Explorer 8 browsers.

但是在某些Internet Explorer 8浏览器中它不起作用。它给出了以下错误。

But in some Internet Explorer 8 browsers it does not work. It gives the following error.

Message: 'JSON' is undefined
Line: 6
Char: 3
Code: 0


Message: '$.namesession' is null or not an object
Line: 53
Char: 2
Code: 0

`

两种情况下Internet Explorer的版本都是相同的。

The version of Internet Explorer in both the cases is same.

但是在Internet Explorer设置中存在一些差异,例如使用SSL3.0 启用智能屏幕过滤​​器复选框在Internet选项的高级选项卡中未选中。

But there were some differences in Internet Explorer settings like Use SSL3.0 and Enable Smart Screen filters check boxes in the Advanced tab in the Internet options were unchecked.

当我们检查它时,它开始工作。当我们取消选中它们时它仍在工作。

When we checked it, it started working. When we unchecked them it was still working.

IE8中的实际问题是什么?

What is the actual problem in IE8?

推荐答案

也许吧不是你想要的,但我有一个类似的问题,我解决了它,包括JSON 2到我的应用程序:

Maybe it is not what you are looking for, but I had a similar problem and i solved it including JSON 2 to my application:

https://github.com/douglascrockford/JSON-js

其他浏览器本机实现JSON,但IE< 8(也是IE 8兼容模式)没有,这就是你需要包含它的原因。

Other browsers natively implements JSON but IE < 8 (also IE 8 compatibility mode) does not, that's why you need to include it.

这是一个相关的问题: IE6上的JSON(IE7)

Here is a related question: JSON on IE6 (IE7)

UPDATE

JSON解析器已更新,因此您应该使用新的解析器: http://bestiejs.github.io/json3/

the JSON parser has been updated so you should use the new one: http://bestiejs.github.io/json3/

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

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