Android, Javascript, Rhino, JSON

不问归期 提交于 2019-12-06 15:46:26

As I understand, you hava some JavaScript script that you want to run by Rhino. If you want to load another JavaScript file, you can use load function:

load("/your/path/json2.js");

After that call your script can use json2 library.

var testStr = '{"test" : {"a": "aval", "b" : "bval"}}';
var jsonObj = JSON.parse(testStr);
var a = jsonObj.test.a;
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!