利用mvc3返回json,這種格式"{\"page\":1,\"rows\":[{\"cell\":[\"ALFKI\",\"Alfreds Futterkiste\",\"Maria Anders\",\"Sales Representative\",\"Obere Str. 57\",\"Berlin\",\"\",\"12209\",\"Germany\",\"030-0074321\",\"030-0076545\"],\"id\":\"ALFKI\"},。。。。。和這種格式{"page":1,"total":91,"rows":[{"id":"ALFKI","cell":["ALFKI","Alfreds Futterkiste","Maria Anders","Sales Representative","Obere Str. 57","Berlin","","12209","Germany","030-0074321","030-0076545"]},哪種正確,可是不管哪種,都顯示不出表格數(shù)據(jù),而是在頁(yè)面中直接輸出了json數(shù)據(jù)。求大神解答
2 回答

慕運(yùn)維8079593
TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超5個(gè)贊
都可以,貌似是你的數(shù)據(jù)錯(cuò)了:
cell是對(duì)象不是數(shù)組:
{"page":"1","total":239,"rows":[{"id":"x1","cell":{"y1":"y1"}},{"id":"x2","cell":{"y2":"y2"}}]}

慕勒3428872
TA貢獻(xiàn)1848條經(jīng)驗(yàn) 獲得超6個(gè)贊
你接收到的是一個(gè)JSON字符串,不是JSON對(duì)象,你用eval轉(zhuǎn)換一下試試
- 2 回答
- 0 關(guān)注
- 769 瀏覽
添加回答
舉報(bào)
0/150
提交
取消