I'm using JSON.Stringify
and JSON.parse
everywhere and it works fine with Firefox. It's working no more with IE9 nor does it work in IE8. What can I do?
The JSON array data type cannot have named keys on an array. When you pass a JavaScript array to JSON. stringify the named properties will be ignored. If you want named properties, use an Object, not an Array.
JSON. stringify() is the opposite of JSON. parse(), which converts JSON into Javascript objects.
The JSON. parse() function is used to convert a string into a JavaScript object while the JSON. stringify() function is used to convert a JavaScript object into a string.
JSON.stringify() calls toJSON with one parameter, the key , which has the same semantic as the key parameter of the replacer function: if this object is a property value, the property name. if it is in an array, the index in the array, as a string. if JSON.stringify() was directly called on this object, an empty string.
JSON.stringify
starts with a lower-case s
. Both stringify
and parse
are available in IE8+, but only in standards mode.
Prepend your document with <!DOCTYPE html>
if you're currently using quirks mode. Also, watch the capitalization of the JavaScript methods you call - all built-in ones start with a lower-case character.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With