Posts Tagged ‘json2’

Ajax JSON.stringify IE7 problem

May 4th, 2011

Just a tip up front.  IE7 runs an older script engine than IE8 and has no full support for Json.

So your code that calls JSON.stringify does not work.

The remedy is to include json2.js from https://github.com/douglascrockford/JSON-js/blob/master/json2.js.  It does not interfere with IE8+.  Just download the file (the “raw” button – saveas) to your script lib and include as so:

<script src="Script/json2.js"; type="text/javascript"></script><!-- Needed for IE7. -->

Running IE9 in compatibility mode does not make this error appear – it seems like IE9-in-IE7-mode is running a newer script engine.

That impediment avoided you are free to continue adding value to your site.