爱游戏

 
 注册成为天翎用户
查看: 10|回复: 0

json工具-爱游戏

[复制链接]
admin 发表于 2023-9-15 16:24:27 | 显示全部楼层 |
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);
})()
您需要登录后才可以回帖 登录 | 注册成为天翎用户

本版积分规则

||爱游戏 ( )

gmt 8, 2023-9-30 12:10

powered by x3.4

爱游戏 copyright © 2001-2020, tencent cloud.

快速回复 返回列表
网站地图