views:

1915

answers:

4

Hi,

I have an iframe application which works fine but the issue comes when the content of iframe is large the text appears to be cut down.

I registered the application as iframe and set as resizable.

I have applied the following code but nothing seems to work

<div id="FB_HiddenIFrameContainer" style="display:none; position:absolute; left:-100px; top:-100px; width:0px; height: 0px;"></div>

<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">
  FB_RequireFeatures(["CanvasUtil"], function(){
    FB.XdComm.Server.init(xd_receiver.htm);
    FB.CanvasClient.setSizeToContent();
  });
</script>

I have xd_receiver.htm file in myapp folder.

Please help me on this

+1  A: 

In my iframe app I use

FB.CanvasClient.startTimerToSizeToContent();

instead of setSizeToContent() which seems to work for me.

Edit: Can your javascript actually see the xd_receiver.htm file? Does it need a path (absolute or relative?) Is Apache serving static files from that directory?

Daniel Roseman
Hi, i have tried this also but its still not working.Please help
Hi, thanks for your reply but how can i determine whether javascript can see the xd_receiver.htm file. pls help
+1  A: 

Hi Pankaj,

What browsers have you observed the problem in? Try running in firefox with firebug installed to debug javasript problems. I'm not sure if the code you posted is actually what you're using, but it seems to be missing quotes on the "xd_receiver.htm" and also, no api key.

Regarding the xd_receiver.htm--> If the path to your callback url is callback, it should exist at callback/xd_receiver.htm. You have specified a relative path, so if your canvas page lives at /foo/page.htm, then the receiver page should exist at /foo/xd_receiver.htm. You could also specify at absolute path like '/xd_receiver.htm' and just keep your xd_receiver at the root.

Your page should look something like this:

http://gist.github.com/156633

Jon Hoffman
pankaj, copy the html from your iframe into a pastebin.org and i can take a closer look
Jon Hoffman
+1  A: 

Hi Jon thanks for replying. I have followed all your suggestions. But i am having the same problem. You can check out the image at link text

The text at the end appears to be cutout.

I have xd_receiver.html file on the root.

Please help me on this

Pankaj Khurana
A: 

did someone solve this ? i have the same problem.. this code isnt working for me, thanks.

  <script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>

<script type="text/javascript">
    FB_RequireFeatures(["CanvasUtil"], function()
    {
      //You can optionally enable extra debugging logging in Facebook JavaScript client
      //FB.FBDebug.isEnabled = true;
      //FB.FBDebug.logLevel = 4;


      FB.XdComm.Server.init("/xd_receiver.htm");
      FB.CanvasClient.startTimerToSizeToContent();
    });
</scrtip>
mm

related questions