I am trying to use JSON.stringify
in my javascript page (EXTJS) code but it's giving me JSON is undefined error. Error happends only in IE (ver.10). This code will work in FF and Chrome. Below is a sample code that I am trying to use. Why is it failing? This seems like a valid example and works in other browsers. Thanks in advance.
var contact = new Object();
contact.firstname = "Joe";
contact.surname = "Smith";
contact.gendere= "male";
var jsonText = JSON.stringify(contact);
Use <!DOCTYPE html>
if you only need to support IE10. If you need to use earlier versions of IE (some people still need to support IE6) you can use the JS implementation of JSON: 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