I'm making an AJAX call to a WCF service and when I pass in my data i use JSON.stringify()
The call returns and works fine in FF, & Chrome, but not IE8. I get an error: 'JSON' is undefined
suggestions?
p.s. I also want this to work in IE7
The JSON-safe values are converted to their corresponding JSON string form. The JSON-unsafe values on the other hand return : undefined if they are passed as values to the method. null if they are passed as an array element.
undefined is not a valid JSON value, even though it is valid in javascript. From the official JSON standard (ECMA-404, Section 5): A JSON value can be an object, array, number, string, true, false, or null. For JSON, use null instead of undefined: { "something": null }
undefined , Function , and Symbol values are not valid JSON values.
Use json2 for a consistent cross browser implementation.
https://github.com/douglascrockford/JSON-js
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