如何使用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(''));
});
我该如何解析这个?
使用jQuery.parseJSON
原生的ECMAScript 5是JSON.parse
。
或者您可以在这里实现它。https://github.com/douglascrockford/JSON-js
相关文章:
- jQuery匹配JSON对象的部分文本
- 在循环中分配json值时,值被覆盖
- 需要帮助设置json数组
- 如何在Javascript中将JSon对象转换为数组
- 我可以在json对象中添加一个函数吗
- 使用JS将数组转换为json对象
- Javascript-如何读取json文件中的列并将其保存在Javascript数组中
- 使用JQuery解析JSON嵌套数组
- 在使用Polymer'加载所有json文件后执行方法;s的核心ajax
- 如何使用json将对象列表从java转换为javascript
- {还没有答案}从 YouTube JSON API 获取评论分数
- 传递对 XBMC json-rpc 的引用以稍后确定答案
- JSON数组-多个有效答案的可能性
- 如何使用jquery解析这个json答案
- jQuery不能从Yii框架的答案中解析JSON
- 有一个JSON需要突出显示ng repeat中与JSON中的答案匹配的答案
- Ajax 不读取 JSON servlet 答案
- Angularjs -如何从服务器json答案中设置模板内容
- 如何使用JavaScript加载本地JSON文件来更新html中的选择列表??(期待简单的答案,我只是一个初学者)
- iccast json-status.xls,无效json答案与空白歌曲标题