首页 > Web开发 > 详细

json集合取值

时间:2015-12-09 17:18:41      阅读:223      评论:0      收藏:0      [点我收藏+]

   var josnStr = {
            "total": 28, "rows": [
        { "productid": "FI-SW-01", "productname": "Koi", "unitcost": 10.00, "status": "P", "listprice": 36.50, "attr1": "Large", "itemid": "EST-1" },
        { "productid": "K9-DL-01", "productname": "Dalmation", "unitcost": 12.00, "status": "P", "listprice": 18.50, "attr1": "Spotted Adult Female", "itemid": "EST-10" }
            ]
        }
        var html = "";

        $.each(josnStr.rows, function (i, item) {
            html += "<div class=‘easyui-panel‘ title=‘My Panel‘ style=‘width:500px;height:150px;padding:10px;background:#fafafa;‘>"
            html += "<p>" + item.productid + "</p>";
            html += "</div>"
        });
        $("body").empty().append(html);

json集合取值

原文:http://www.cnblogs.com/wangtiantian/p/5033009.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!