Java 6 ScriptEngine and JSON.parse problem

Posted by Tim on Stack Overflow See other posts from Stack Overflow or by Tim
Published on 2010-03-08T22:53:45Z Indexed on 2010/03/08 23:21 UTC
Read the original article Hit count: 321

Filed under:
|
|
|

The Rhino release that is included in Java 6 ScriptEngine does not have a JSON parser. I've tried including crockfords JSON2.js in my script on the scriptengine.eval(). When I try to do the JSON.parse, it ends up giving me a script error that .replace is an unknown function. .replace is referenced several places in JSON2, and it works fine inside a browser (IE7, IE8, FF3). Anyone see this and have a suggestion?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about rhino