博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JS 解析服务端返回的json数组
阅读量:5268 次
发布时间:2019-06-14

本文共 1235 字,大约阅读时间需要 4 分钟。

从服务器端返回的json如下:

{"idcNodeList":[

{"nodeType":0,"nodeName":"测试节点1","nodeId":"BG1f3KrE-oKI0XSQI~~~","createTime":"2015-07-21 14:39:58.000+0800","updateTime":"2015-07-21 14:39:58.000+0800","changeTime":"2015-07-21 16:01:33.000+0800","nodeStatus":1,"nodeIp":"192.168.200.75","nodePort":8099},

{"nodeType":0,"nodeName":"测试节点3","nodeId":"BGgDnlnZ7hINQiSpc~~","createTime":"2015-07-21 14:39:58.000+0800","updateTime":"2015-07-21 14:39:58.000+0800","changeTime":"2015-07-21 16:01:34.000+0800","nodeStatus":1,"nodeIp":"192.168.200.246","nodePort":9012}]}

success: function(data) {
var obj = eval("("+data+")"); for(var i = 0 ; i < obj["idcNodeList"].length; i++) {
var temNodeId = escapeJquery(obj["idcNodeList"][i]["nodeId"]); $("#"+temNodeId).html( (obj["idcNodeList"][i]["nodeStatus"] )); } }

  {

  "result": [{
      "data": [{"id": 61,"parentId": ""}],
      "colSource": 0,
      "colSql": "select id,platform as name,'' as parentId from pi_om_platform",
      "colType": 0,
      "colId": "1",
      "colName": "平台",
      "colOrder": 1,
      "colShow": 0,
      "colActive": 0
    }]
  }

 

success: function(data) {
alert( data.result[0].data[0].id); }

 

转载于:https://www.cnblogs.com/T8023Y/p/4665219.html

你可能感兴趣的文章
android:scaleType属性
查看>>
mysql-5.7 innodb 的并行任务调度详解
查看>>
shell脚本
查看>>
Upload Image to .NET Core 2.1 API
查看>>
Js时间处理
查看>>
【雷电】源代码分析(二)-- 进入游戏攻击
查看>>
Entityframework:“System.Data.Entity.Internal.AppConfig”的类型初始值设定项引发异常。...
查看>>
Linux中防火墙centos
查看>>
如何设置映射网络驱动器的具体步骤和方法
查看>>
centos下同时启动多个tomcat
查看>>
slab分配器
查看>>
【读书笔记】C#高级编程 第三章 对象和类型
查看>>
【SVM】libsvm-python
查看>>
Jmeter接口压力测试,Java.net.BindException: Address already in use: connect
查看>>
Leetcode Balanced Binary Tree
查看>>
go:channel(未完)
查看>>
[JS]递归对象或数组
查看>>
多线程《三》进程与线程的区别
查看>>
linux sed命令
查看>>
html标签的嵌套规则
查看>>