jquery json
来源:互联网 发布:阿里云 弹性ip bgp带宽 编辑:程序博客网 时间:2024/06/06 05:03
发起请求
function testClick() {
//alert('开始测试json');
$.ajax({ url:'Default.aspx', //后台处理程序
type:'get', //数据发送方式
dataType:'json', //接受数据格式
data:{"act":"test"},//要传递的数据
success:update_page //回传函数(这里是函数名)
});
}
返回数据 {'totalCount':7, 'root':[ {'gcIndex':'1','Match':'australia','Message':'3|Error: View Details, please refer to the log file'}, {'gcIndex':'2','Match':'canada2','Message':'1|last No.519754'}, {'gcIndex':'3','Match':'canada','Message':'1|last No.1164047'}, {'gcIndex':'4','Match':'eklub','Message':'1|last No.298742'}, {'gcIndex':'5','Match':'keno8','Message':'1|last No.333185'}, {'gcIndex':'6','Match':'maltco','Message':'1|last No.317093'}, {'gcIndex':'7','Match':'maryland','Message':'2|Warning: View Details, please refer to the log file'} ] }
解析
function update_page(json) {
$("#test").html('');
$("#test").append(Year_Month()+" " +Date_of_Today()+" " +Day_of_Today()+" " + CurentTime() +"");
var retCnt = json.totalCount;
var info = json.root;
for(var i = 0;retCnt >0 && i < retCnt; i++)
{
$("#test").append("index:"+info[i].gcIndex+" Match:"+info[i].Match+" Message:"+info[i].Message +"");
}
}
function testClick() {
//alert('开始测试json');
$.ajax({ url:'Default.aspx', //后台处理程序
type:'get', //数据发送方式
dataType:'json', //接受数据格式
data:{"act":"test"},//要传递的数据
success:update_page //回传函数(这里是函数名)
});
}
返回数据 {'totalCount':7, 'root':[ {'gcIndex':'1','Match':'australia','Message':'3|Error: View Details, please refer to the log file'}, {'gcIndex':'2','Match':'canada2','Message':'1|last No.519754'}, {'gcIndex':'3','Match':'canada','Message':'1|last No.1164047'}, {'gcIndex':'4','Match':'eklub','Message':'1|last No.298742'}, {'gcIndex':'5','Match':'keno8','Message':'1|last No.333185'}, {'gcIndex':'6','Match':'maltco','Message':'1|last No.317093'}, {'gcIndex':'7','Match':'maryland','Message':'2|Warning: View Details, please refer to the log file'} ] }
解析
function update_page(json) {
$("#test").html('');
$("#test").append(Year_Month()+" " +Date_of_Today()+" " +Day_of_Today()+" " + CurentTime() +"");
var retCnt = json.totalCount;
var info = json.root;
for(var i = 0;retCnt >0 && i < retCnt; i++)
{
$("#test").append("index:"+info[i].gcIndex+" Match:"+info[i].Match+" Message:"+info[i].Message +"");
}
}
- jquery json
- jQuery + JSON
- jquery+json
- jquery json
- Jquery+Json
- jquery,json
- JQuery JSON
- Jquery----json
- Jquery JSON
- jquery json
- jquery json
- jquery json
- jQuery JSON
- Jquery - JSOn
- jQuery/JSON
- Jquery+json
- jquery json
- Jquery - JSON / JSON string
- 【筛选法】欧教发糖
- arm-elf和arm-eabi的区别
- 加密算法简介
- MFC的COleDateTime类使用
- 如何使用Activity创建对话框
- jquery json
- GridView导出成Excel(整理)
- automake,autoconf使用详解
- 重要blog关注
- Excel 匯出,服務器文件資料下載
- VC操作Excel,使用Worksheet的get_Range发生异常
- 利用DB_LINK在不同平台的数据库中复制数据。
- 通过System.getProperties()获取系统参数
- GridView导出成Excel遇到的问题整理