日期:2014-05-18  浏览次数:20820 次

关于Json的几点疑问,希望有人解答!
1.
dataObj = {
    rows: [{
        id: 1001,
        data: ["100", "A Time to Kill", "John Grisham", "12.99", "1", "05/01/1998"]
        }, {
        id: 1002,
        data: ["1000", "Blood and Smoke", "Stephen King", "0", "1", "01/01/2000"]
        }, {
        id: 1003,
        data: ["-200", "The Rainmaker", "John Grisham", "7.99", "0", "12/01/2001"]
        }, {
        id: 1004,
        data: ["350", "The Green Mile", "Stephen King", "11.10", "1", "01/01/1992"]
        }, {
        id: 1005,
        data: ["700", "Misery", "Stephen King", "7.70", "0", "01/01/2003"]
        }, {
        id: 1006,
        data: ["-1200", "The Dark Half", "Stephen King", "0", "0", "10/30/1999"]
        }]
};


这段json中,在js中怎样得到dataObj中,第6个data的第一个值,"-1200".



2.我一般在java后台把list转换为json之后,会成为这种格式:
[{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"14:18:25","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"11:18:25","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"22:44:25","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"14:18:22","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"14:44:25","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"22:44:33","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"","test3":"","test4":"","test5":"","time":"16:55:44","userip":"253.33.22.32","usernum":"543"},{"WTserverip":"232.32.32.2","date":"2013-05-24","gotoclass":"1232","servclass":"1","serverip":"332.3.323.22","state":"2","test1":"","test2":"