天翎MyApps技术社区 - 低代码平台 | 流程管理系统 | BPM软件

 找回密码
 注册成为天翎用户
查看: 2008|回复: 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);
})()

本版积分规则

QQ|手机版|天翎MyApps技术社区 ( 粤ICP备11093750号 )

GMT+8, 2026-8-12 04:45

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表