Wednesday, 21 August 2013

Google Feed Api bug in ie8?

Google Feed Api bug in ie8?

Google Feed does not get loaded in ie8 at the very first time. Here's the
code (exactly from
https://developers.google.com/feed/v1/devguide#hiworld):
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("feeds", "1");
function initialize() {
var feed = new
google.feeds.Feed("http://fastpshb.appspot.com/feed/1/fastpshb");
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 div = document.createElement("div");
div.appendChild(document.createTextNode(entry.title));
container.appendChild(div);
}
}
});
}
google.setOnLoadCallback(initialize);
</script>
</head>
<body>
<div id="feed"></div>
</body>
</html>
And if you refresh the page, then it works fine, but if you clear the
cache (plus restart the browser, is freaking ie, so...) it will happen
again, all the time.
Try to print out the json object of google.feed via
for(var key in google.feeds){
console.log(key);
}
gets only 3 keys: Version, JSHash, LoadArgs
Tried calling new google.feeds.Feed() in a timeout, if google.feeds.Feed
is undefined, but it didn't work as well, as it kept staying as undefined.
Anyone has any other idea or workaround? Thanks.

No comments:

Post a Comment