jquery处理多维数组

后台接口发回多维数组:
def arrays(req):
    print req.get_full_path()
    a=[[12,23,34],[44234,4242,5353],['a','bbb','ccc']]
    print a
    return HttpResponse(json.dumps(a), content_type="application/json")


JS:
node2:/django/mysite/static/Js/Monitor#cat displayarrays.js 
$(function() {
    var _env_bt = $(".content .con #condition .es_2");
    _env_bt.on('click',
    function() {
        var __user = $(".equipment_sz1").val();
        var __password = $(".equipment_sz2").val();
        var __port = $(".equipment_sz3").val();
        var __ip = $(".equipment_sz4").val();
        var __db = $(".equipment_sz5").val();
        var data = {};
        data.user = __user;
        data.password = __password;
        data.port = __port;
        data.ip = __ip;
        data.db = __db;
        //var i = 0;
        var successfn = function(jdata) {
            var jdata = eval(jdata);
            $(".gridtable").empty();
            var _HTML = "a1a2a3";
              $(".gridtable").empty();
              var _HTML="IP InfoENV";
              $.each(jdata,function(i,val){
                _HTML=_HTML+""+jdata[i][0]+""+jdata[i][1]+""+jdata[i][2]+"";
                });
            $(".gridtable").html(_HTML);
        };
        var errorfn = function() {
            alert("数据获取出错");
        };
        $.ajax({
            type: "get",
            data: data,
            url: "/news/arrays/",
            dataType: "json",
            success: function(d) {
                successfn(d);
            },
            error: function(e) {
                errorfn(e);
            }
        });
    });

});

你可能感兴趣的:(Django1.8文档)