加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

客户端脚本与webService交互类型

发布时间:2020-12-17 02:52:09 所属栏目:安全 来源:网络整理
导读:如果webservice返回数据集DataSet,客户端java脚本如何取得数据呢? 可以通过在webservice中把dataset转换为数组。如employee[ ] 然后在客户端脚本,声明多个数组变量. 在客户端脚本的webservice回调函数中,遍历回调参数值。 然后利用result[i].x的形式给声明

如果webservice返回数据集DataSet,客户端java脚本如何取得数据呢?

可以通过在webservice中把dataset转换为数组。如employee[ ]

然后在客户端脚本,声明多个数组变量.

在客户端脚本的webservice回调函数中,遍历回调参数值。

然后利用result[i].x的形式给声明的变量数组赋值.

function showdepartments1(result) {

?????? if (result && result.length != 0) {
??????????? var points = new Array();
??????????? var names = new Array();
??????????? var ids = new Array();
??????????? opers = new Array();
??????????? addrs = new Array();
??????????? teles = new Array();
??????????? for (var i = 0; i < result.length - 1; i ++) {
??????????????? if (!(result[i].x == 0 && result[i].y == 0)) {
??????????????????? points.push(new LTPoint(result[i].x,result[i].y));
??????????????????? names.push(result[i].depname);
??????????????????? ids.push(result[i].id);
??????????????????? opers.push(result[i].operation);
??????????????????? addrs.push(result[i].address);
??????????????????? teles.push(result[i].telephone);
??????????????? }
??????????? }
??????????? show(points,names,ids);
??????? } else {
??????????? map=new LTMaps("myMap");
??????????? map.cityNameAndZoom( "xian",13 );

??????? }?}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读