您的位置:首页 > Web前端 > JavaScript

ajax同步开发——json+对应的处理方式直接贴上被我滥用的代码标本吧:

2016-08-05 14:47 543 查看
直接贴上被我滥用的代码标本吧:

返回json数组形式
[{"expressName":"\u987a\u4e30","expressNum":"sf001"}]

htmlobj = $.ajax({url:'<?php echo site_url('Index/queryExpress');?>',
async:false,
method:'get',
dataType: 'json',
data: {orderid:$(".order-no").text()}
});
jsonstr = htmlobj.responseText;
json = eval(jsonstr);
for(var i=0; i<json.length; i++)
{
//alert(json[i].expressName+" " + json[i].expressNum)
$("#order-detail .detail-row11 .expressName").text(json[i].expressName);
$("#order-detail .detail-row11 .expressNum").text(json[i].expressNum);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: