繁体   English   中英

如何使用jQuery解析这个JSON答案

[英]How to parse this json answer using jquery

[{"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(''));
});

我应该如何解析?

ECMAScript 5的本机是JSON.parse

或者,您可以在此处实现它。 https://github.com/douglascrockford/JSON-js

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM