ajax json eval()

来源:互联网 发布:信用评分卡模型python 编辑:程序博客网 时间:2024/06/07 11:39

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},…]




jQuery自动加载更多程序


jquery如何解析数组(JSONArray)

$.ajax()方法详解

本文实例讲述了jquery通过ajax加载一段文本内容的方法
jQuery+AJAX实现无刷新下拉加载更多

0 0