tags:

views:

107

answers:

2

Hi,

I need to use:

JSON.stringify()

which should be supported by chrome, safari, and FF (I think). I think IE8 also has support for the JSON object. I think IE7 and 6 do not, so I'm doing this:

<!--[if lt IE 8]>
    <script src="http://www.json.org/json2.js"&gt;&lt;/script&gt;
<![endif]-->

so, I think this will import the external javascript only if IE6 & 7. I looked at the url where the script is hosted, they are including only if the IE version is less than 9:

http://code.google.com/p/html5shiv/
<!--[if lt IE 9]>
    <script src="http://www.json.org/json2.js"&gt;&lt;/script&gt;
<![endif]-->

so should I be including this for IE 8 too?

Thanks

--------------- Pointed script source to json parser js ---------------

+1  A: 

A shiv just createElement's the HTML5 elements. It has nothing to do with JSON. Try getting an actual JSON parser like json2.js from Crockford.

meder
I agree that the json parser is the best bet.
James Black
Ok is the above use correct then - I pointed to the correct js file I think - but is it necessary for IE8? Or does it need to be included only for IE6 and IE7? Thanks