zoukankan      html  css  js  c++  java
  • json集合取值

       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='500px;height:150px;padding:10px;background:#fafafa;'>"
                html += "<p>" + item.productid + "</p>";
                html += "</div>"
            });
            $("body").empty().append(html);

  • 相关阅读:
    [包计划] date-fns
    [包计划] create-react-app
    [包计划] js-cookie
    [包计划] cheerio
    [包计划] 30-seconds-of-code
    new
    [源计划] array-first
    [源计划] is-sorted
    [源计划] array-flatten
    images
  • 原文地址:https://www.cnblogs.com/wangtiantian/p/5033009.html
Copyright © 2011-2022 走看看