Book a Demo

Author Topic: JSON.stringify: JSON is undefined  (Read 12631 times)

Adam P

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
JSON.stringify: JSON is undefined
« on: January 16, 2015, 06:51:40 pm »
I'm trying to use JSON.stringify in JScript, but when I call the function I get the error "JSON is undefined". The MSDN documentation for JScript says that the JSON object is a built-in and can't be created using a new call:
http://msdn.microsoft.com/en-us/library/cc836458%28v=vs.84%29.aspx

Is the JSON object not included in EA?

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: JSON.stringify: JSON is undefined
« Reply #1 on: January 22, 2015, 02:25:55 am »
I dont think that is included in EA, you can however use them by adding JSON2.js in your local folder and then referring it in your code.

Adam P

  • EA Novice
  • *
  • Posts: 11
  • Karma: +0/-0
    • View Profile
Re: JSON.stringify: JSON is undefined
« Reply #2 on: January 22, 2015, 03:07:56 am »
Thanks. Do you have a link to JSON2.js?

Aswin Krishnan H

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: JSON.stringify: JSON is undefined
« Reply #3 on: January 22, 2015, 02:59:43 pm »
Code: [Select]
https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.js

https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.min.js

http://www.json.org/js.html

https://github.com/douglascrockford/JSON-js