2011-12-20 57 views
0
[{"ID":83,"post_author":"1","post_date":"2011-12-20 19:17:52","post_date_gmt":"2011-12-20 19:17:52","post_content":"This is my fiat project","post_title":"Fiat","post_excerpt":"","post_status":"publish","comment_status":"open","ping_status":"open","post_password":"","post_name":"fiat","to_ping":"","pinged":"","post_modified":"2011-12-20 19:17:52","post_modified_gmt":"2011-12-20 19:17:52","post_content_filtered":"","post_parent":0,"guid":"http:\/\/imiodrag.dyndns.org:8080\/other_media\/?p=83","menu_order":0,"post_type":"post","post_mime_type":"","comment_count":"0","filter":"raw"}] 

    $.get('http://foo.com/lol', function(data) { 
    var items = []; 

    $.each(data, function(key, val) { 
    $.each(val, function(key1, val1) { 
     items.push('<li id="' + key1 + '">' + val1 + '</li>'); 
    }); 

}); 
$('.content').html(items.join('')); 
}); 

我應該如何解析?如何使用jquery解析此json答案

+0

解析什麼?問一個真正的問題來獲得真實的答案。 – Malvolio 2011-12-20 22:30:40

+0

[使用JQuery解析這個JSON文件]可能的重複(http://stackoverflow.com/questions/1668627/parse-this-json-file-using-jquery) – aefxx 2011-12-20 22:31:04

回答

1
+0

$('。ss a')。live('點擊',函數(){。{0} .getJSON('http://foo.com/category/default/',function(data){ var obj = jQuery.parseJSON(data); $('。red' ).html(obj.post_content); }); return false; });仍然不起作用 – Uffo 2011-12-20 22:42:58

+0

使用每個解決 – Uffo 2011-12-20 22:44:57