我正在阅读RSS feed篇文章,并将标题和链接放入Jquery的数组中.
What i did is
var arr = [];
$.getJSON("displayjson.php",function(data){
$.each(data.news, function(i,news){
var title = news.title;
var link = news.link;
arr.push({title : link});
});
});
我正在使用以下命令再次读取该数组
$('#show').click(function(){
$.each(arr, function(index, value){
alert( index +' : '+value);
});
});
But it Giving me Output as
1:[Object Object]
2:[Object Object]
3:[Object Object]
like this ...
如何将tile和link作为一对(title as key and link as value)