我想使用jquery解析這個json,並且每個都有一個循環。我只看到json的例子,它用一個標題(如結果)包裝在數組中。我如何解析像下面的json ...?如何使用.each解析json數組而不使用外部名稱?
$.each(json.results, function() { console.log(this['title']); });
[{"title":"About Us","url_title":"about_us","entry_id":"155","channel_id":"2","author_id":"1","status":"open","entry_date":"1287508538","edit_date":"20101209122240","expiration_date":"0","about_body":"We are the greatest.","about_image":"","about_staff_title":"Joe","about_extended":"More about us.","color":"d12626"},{"title":"Contact Us","url_title":"contact_us","entry_id":"223","channel_id":"2","author_id":"1","status":"open","entry_date":"1291918929","edit_date":"20101209122310","expiration_date":"0","about_body":"Email us.","about_image":"","about_staff_title":"Bob","about_extended":"","color":"080480"}]
您的預期結果是什麼? – zizozu 2011-12-18 05:18:28
喜歡這個? http://jsfiddle.net/TuhHt/ – 2011-12-18 05:21:53
謝謝賈裏德,工作完美! – 2011-12-18 05:25:46