Can I run a JavaScript function AFTER Google Loader has run?
- by thatryan
I am loading Google API using google.load() and I need to process some of what is built by it, but I need to run the JavaScript after it has already completely loaded, is there a way to ensure that happens?
Here is how I build the list of images, I need to add an attribute to each img tag though, can't do that until after it is built right?
google.load("feeds", "1");
function initialize() {
var feed = new google.feeds.Feed("myfeed.rss");
feed.load(function(result) {
if (!result.error) {
var container = document.getElementById("feed");
for (var i = 0; i < result.feed.entries.length; i++) {
var entry = result.feed.entries[i];
var entryTitle = entry.title;
var entryContent = entry.content;
imgContent = entryContent + "<p>"+entryTitle+"</p>";
var div = document.createElement("div");
div.className = "image";
div.innerHTML = imgContent;
container.appendChild(div);
}
}
});
}
google.setOnLoadCallback(initialize);