0

I'm trying to resize the iFrame in my Facebook canvas app with Javascript. I know how to do this in the code- it's working fine.

However, I can't seem to get it to work in the console, for testing purposes. In the console, FB is defined but FB.Canvas is not (the closest is FB.CanvasClient). Why is that? How can I test iFrame resizing in the console?

bevanb
  • 8,201
  • 10
  • 53
  • 90

2 Answers2

1

You have to run the FB.Canvas inside the fbAsyncInit and after FB.init,
always use window.fbAsyncInit to run the init code after the api load.

//initializing API
window.fbAsyncInit = function() {
    FB.init({
        appId      : APP_ID,
        status     : true,
        cookie     : true,
        xfbml      : true
    });

    FB.Canvas.setSize({ width:810, height:850 });
    FB.Canvas.setAutoGrow();
};
Philip
  • 5,011
  • 2
  • 30
  • 36
0

You can resize your IFrame through developer.facebook.com

From the app you are working on click on advanced. in that page you will see canvas size. make it Fluid.

DarthVader
  • 52,984
  • 76
  • 209
  • 300