|
1、(static) parse(text, reviver) → {object} 解析字符串为json对象
示例:
(function(){
var text = '{"a":"hello","b":"world"}';
var json = json.parse(text);
getcurrentdocument().finditem("结果1").setvalue(json.a)
println("json b:" json.b);
})()
2、(static) stringify(value, replacer, space) json对象转字符串
示例:
(function(){
var json = {a:"hello",b:"world"};
var text = json.stringify(json);
getcurrentdocument().finditem("结果2").setvalue(text);
println("json text:" text);
})() |
|