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);
})()
文档更新时间: 2023-09-16 02:19 作者:admin