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);

  • 相关阅读:
    vb笔记
    linux学习笔记
    linnux--shell
    # 用类来封装动态数组:分文件编写
    面向对象
    c++2
    c++1
    答疑:指针数组字符串
    文件操作
    用函数封装实现对一个数组增删改查
  • 原文地址:https://www.cnblogs.com/wangtiantian/p/5033009.html
Copyright © 2011-2022 走看看