Ok so I have a basic function that get's 2 feeds. My issue is that the function, running asynchronously skips down to the alert function(in for testing) before it's doing the function to get both feeds. I'm sure there's a viable solution but it has me scratching my head. here's the script. I'd greatly appreciate the help, thanks!
function getFeeds(){
jQuery.getFeed({
url: 'proxy.php?url='+feed1,
success: function(feed) {
for(var i = 0; i < feed.items.length && i < 10; i++) {
var item = feed.items[i];
s_string += '<div class = \"cont_div a'+i+'\"><h2>'
/* + '<a href="'
+ item.link
+ '">'*/
+ item.title
/*+ '</a>'*/
+ '</h2></div>';
/* html += '<div class="updated">'
+ item.updated
+ '</div>';
html += '<div>'
+ item.description
+ '</div>';*/
}
}
});
jQuery.getFeed({
url: 'proxy.php?url='+feed2,
success: function(feed) {
for(var i = 0; i < feed.items.length && i < 10; i++) {
var item = feed.items[i];
s_string += '<div class = \"cont_div a'+i+'\"><h2>'
/* + '<a href="'
+ item.link
+ '">'*/
+ item.title
/*+ '</a>'*/
+ '</h2></div>';
/* html += '<div class="updated">'
+ item.updated
+ '</div>';
html += '<div>'
+ item.description
+ '</div>';*/
}
}
});
alert(s_string);
}