Facebook JavaScript SDK FB.Canvas.setSize and setAutoGrow not working in IE7/8

Currently I'm testing a Facebook tab page. I am using the JavaScript SDK with the recommended async init method:

window.fbAsyncInit = function() {
        FB.init({
          appId      : app_id,
          status     : true, 
          cookie     : true, 
          oauth      : true,
          xfbml      : true 
        });


        FB.getLoginStatus( loginStatus );
        FB.Canvas.setAutoGrow( );
        FB.Canvas.setSize( {height: 1200 });


     };

     (function(d){
         var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
         js = d.createElement('script'); js.id = id; js.async = true;
         js.src = "//connect.facebook.net/en_US/all.js";
         d.getElementsByTagName('head')[0].appendChild(js);
     }(document));

I am having issues in IE7/8 where the setAutoGrow and setSize are not responding. My tab page is NOT resizing to the full content at all. Instead in IE console I am getting this error whenever I call either setAutoGrow or setSize:

SCRIPT438: Object doesn't support this property or method all.js, line 15 character 3916

I tested this in Chrome/FF/IE9 PC/MAC and all works fine, only IE7/8 are giving me these issues. Anyone know if these are known bugs with FB's JS SDK or am I doing something wrong?

Answers


<script type="text/javascript">
    FB.Canvas.setSize({ width: 520, height: 1400 });
    window.fbAsyncInit = function () {
        FB.Canvas.setAutoResize();
    }
</script>

Use this and put it right before closing body tag.

also make sure you have this markup inside the body tags also:

<div id="fb-root"></div>
<script type="text/javascript" src="//connect.facebook.net/en_US/all.js"></script>

Need Your Help

IOS App Id type in provisioning profile

iphone ios provisioning

I'm very new to IOS so pardon my "rookieness". My question is: Is there a way to tell whether an App_Id is either wildcard or explicit in the apple provisioning profile's page? I see the ids are ...

form_for creates the wrong url

ruby-on-rails

I'm creating a form that should post to /users/:user_id/user_languages

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.