I saw a similar post to this, so I tried to follow the answer of that question but it didn't work. Where is my mistake? I think it should display "My function can run here :)". But both RSS feeds and this alert dont appear.
google.load("feeds", "1");
function initialize(callback) {
var feed = new google.feeds.Feed("http://www.ntvmsnbc.com/id/24927681/device/rss/rss.xml");
feed.setNumEntries(6);
feed.load(function(result) {}){
if (!result.error) {
var container = document.getElementById("feed");
var html = '';
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var a= " ";
a += entry.title;
info[i] = a;
callback();
html += '<p>' + entry.publishedDate + ' ' + entry.title;
}
container.innerHTML = html;
}
});
}
google.setOnLoadCallback(function(){
//Run the Initialize Function
initialize(function(){
//Run anything else here like
alert("My function can run here :)")
});
});
Ok I'm updating my question =). Instead of this alert, can I add entry.title into an array in this function? If yes, what should I write there