Wednesday, June 1, 2011

htmlStorage bug in Facebook's new SDK ..

Facebook must have rolled out a new SDK that breaks IE7. You can't see the problem in IE8/IE9 and simulating the bug within the browser since they already support the localStorage object. You have to load an IE7 browser to see the issue:

If you put this line in your JavaScript code before the Facebook code loads,

if (typeof(localStorage) === "undefined") {
  var localStorage = {};

The problem appears to happen inside the FB.init code:

FB.provide('', {
  initSitevars: {},
  init: function(a) {
    FB.Event.subscribe('auth.sessionChange', FB.TemplateData.update);

Commenting out the FB.TemplateData.init() and FB.TemplateData.update code fixes things..

No comments:

Post a Comment