Sidebar

Why is JSON not defined?

+1 vote
8.6K views
asked Aug 12, 2013 by mike-r-7535 (13,830 points)
edited Aug 12, 2013 by mike-r-7535

I use JSON in my channels and have both a Test and Production QIE server.  In Test, I can use JSON.stringify(), but I can't in my Production environment.  Here is a screenshot of my mapping node:

When I run the channel in my Production environment, I get the following: 'ReferenceError: "JSON" is not defined.'

What I am doing wrong?

2 Answers

0 votes
 
Best answer

To resolve this issue, upgrade your Production environment to Java7.

A general rule of thumb, is that if you use JSON or create your own JS Arrays or JS Objects within your channels, you should use java version 7.

For more information, see: http://qvera.com/kb/index.php/118/what-version-of-javascript-does-qie-support?show=118#q118.

answered Aug 12, 2013 by mike-r-7535 (13,830 points)
selected Aug 12, 2013 by mike-r-7535
0 votes

If Java 6 is a requirement and you still want to use json, I would look into using a java API which can parse and stringify JSON.  Google's GSON may be a good option: https://code.google.com/p/google-gson/.  However, I have not tried using this API in QIE.

answered Mar 5, 2014 by mike-r-7535 (13,830 points)
...