"JSON" - Undefined JavaScript Error in Internet Explorer

We use jQuery in our application. We used the jQuery plugin to implement a JavaScript session.

It works correctly in Firefox and most Internet Explorer 8 browsers.

But in some browsers, Internet Explorer 8 does not work. He 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 

`

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

But there were some differences in the settings of Internet Explorer, such as Use SSL3.0 and Enable Smart Screen, the checkboxes on the "Advanced" tab in the Internet settings were unchecked.

When we tested it, it started to work. When we took them off, he was still working.

What is the actual issue in IE8?

+49
json javascript jquery internet-explorer
Mar 17 '11 at 12:51
source share
7 answers

Perhaps this is not what you are looking for, but I had a similar problem, and I decided to include it, including JSON 2, in my application:

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

Other browsers initially implement JSON, but IE <8 (also IE 8 compatibility mode) does not mean you need to enable it.

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

UPDATE

The JSON parser is updated, so you should use the new one: http://bestiejs.imtqy.com/json3/

+67
Mar 17 '11 at 12:55
source share
 <!DOCTYPE html> 

Otherwise, IE8 does not work correctly. Also you should use:

 <meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> 
+18
Jun 28 '13 at 10:57
source share

Add the json2.js project to your project. I ran into the same problem that I fixed.

use the link: https://raw.github.com/douglascrockford/JSON-js/master/json2.js and create a new json.js file, copy the page and flash it into the newly created file and move this file to your web application.

I hope this works.

+7
Dec 13 '12 at 16:35
source share

Check for extra commas in the JSON response. If the last element of the array has a comma, this will break in IE

+6
Mar 17 2018-11-12T00:
source share

Change the content type to "application / x-www-form-urlencoded"

+3
May 20 '12 at 6:34
source share

I had this error 2 times. Each time this was solved by changing the ajax type. Either GET for POST or POST for receiving.

 $.ajax({ type:'GET', // or 'POST' url: "file.cfm?action=get_table&varb=" + varb }); 
0
Apr 10 2018-12-12T00:
source share

I have had the same issue recently. In my case, at the top of the php script, I had some code generation, obviously some additional output to the browser. Removing empty lines (between?> And the html tag) and a simple cleanup helped me:

 <?php include('../config.php'); // ob_clean(); ?> <!DOCTYPE html> 
0
Nov 10 '14 at 17:05
source share



All Articles