json数据为一串数组形如
[{color: "#1c15e6", id: 1, position: "0", size: "1", text: "葫芦岛周润发到此一游", time: 5, videoId: 0},…]
ajax解析时在success中
$.each(data, function() {
alert(this.id);
});
这样就会挨个解析每个大括号内的id了
htmlobj = $.ajax({
url : " ",
async : false
});
var reJson = htmlobj.responseText;
reJson = eval("(" + reJson + ")");
上面这段代码,reJson的值就是:
[{color: "#1c15e6", id: 1, position: "0", size: "1", text: "葫芦岛周润发到此一游", time: 5, videoId: 0},…]