json循环问题

json数据:

[{"userID":"151","pay":"5.3","paywhat":"米饭1碗","paytime":"2017-07-04 09:25:14","payaddr":"0"},{"userID":"151","pay":"5.3","paywhat":"aa","paytime":"2017-07-04 17:52:58","payaddr":"0"},{"userID":"151","pay":"5.3","paywhat":"","paytime":"2017-07-05 10:04:41","payaddr":""},{"userID":"151","pay":"5.3","paywhat":"","paytime":"2017-07-05 10:05:00","payaddr":""},{"userID":"151","pay":"5.3","paywhat":"","paytime":"2017-07-05 10:05:18","payaddr":""}]

ajax请求

http://img.mukewang.com/595d9d0000015c6511220424.jpg

结果:

http://img.mukewang.com/595d9d2b00019eff07210151.jpg

因为使用了document.write();把原来的元素都替换了 但如果不使用document.write() 数据只能拿到一条;

求大神解答;

其实主要目的是把json数组循环到表格里


_PHP_
浏览 1570回答 1
1回答

李晓健

把你的js代码  帖出来  帮你改
打开App,查看更多内容
随时随地看视频慕课网APP