I am modifying my previous question since I feel this problem is closely related to putting an entry in map from ajax call. There is nothing wrong with Map.
EDIT :-
I am populating a map of feeds in following ways where key represent url and value represent feeds;
channelMap.each(function(key,url,n){
loadFeedFor(url,10);
console.debug(feedMap);
});
:
function loadFeedFor(url,maxposts){
var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url;
if(maxposts != null) gurl += "&num="+maxposts;
$.getJSON(gurl, function(){})
.done(function(data){
feeds = data.responseData.feed;
feedMap.put(url,feeds);
});
}
But it is not working. I guess I would have to use Deffered for this problem but have no idea how.
I am using map from this answer.
I tried doing same thing in another way where I am not using map. I am calling following function with different 3 rss feeds url;
function rssfeedsetup(feedId,feedurl,feedlimit){
var feedpointer=new google.feeds.Feed(feedurl); //Google Feed API method
feedpointer.setNumEntries(feedlimit); //Google Feed API method
feedpointer.load(function(response){
console.log(response.feed);
return setTimeout(displayFeed(response.feed,feedId), 3000);
}); //Google Feed API method
}
console prints all feeds properly (25 entries). But feeds actually appear on page are always less. Even delay is not helping me.