Talk:Fb:iframe
From Facebook Developers Wiki
Contents |
[edit] Slow Iframes
Is fb:iframe insanely slow for anyone else? It takes at least 10 seconds to load pages < 10k when hitting the page directly loads it instantly on a fresh browser. What gives?
I noticed that TopFriends uses an iframe and it is quite fast -- how did they get the speeds up?
[edit] setting fb:iframe size dynamically
Is it possible to change the height of fb:iframe based on it's content's size?
[edit] sending get parameters to your iframe
I don't know why it's not described here, but if you need to pass get params to your iframe, list them as args within the <fb:iframe /> tag. Don't try to append them to the src tag.
So don't do this:
<fb:iframe src="http://yoururl.com/your_file.jsp?x=1" />
Do this instead:
<fb:iframe src="http://yoururl.com/your_file.jsp" x="1" />
Would it be so hard for someone at Facebook to take the time to explain this?
Added- jul 1 08 by john o'donovan
Strange. I tried this with my PHP facebook application. The value passed successfully with this syntax:
<fb:iframe src="http://yoururl.com/your_file.php?x=1" />
but did not work when I used: <fb:iframe src="http://yoururl.com/your_file.php" x="1" />
It would be good if facebook could explain why this behaves differently.
[edit] smartsize
What I don't get it and cannot seem to find out is what form the syntax for coding the attributes should take e.g. should smartsize be something like
smartsize="100%"
Which would be similar to height and width in HTML.
Anyone any idea if I am heading in the right direction, I can't seem to get it working??
Well I figured it out, so I have added the solution to the wiki mainpage on fd:iframe
[edit] Appending?
Could someone help me with what i have to do to a page in order to get it to show up in the fb:iframe? I am confused...
[edit] smartsize issues
If you use the smartsize="true" tag, it resizes the iframe properly, which is great. But if you put content below the iframe, it doesn't account for that height when resizing, so the page is for example 35 pixels too long if there is a div below the iframe with a height of 35 pixels. This puts vertical scrollbars on the very right edge of the page when they're not needed if the iframe is smaller than a page anyway.
There's a workaround I found - if you create another iframe underneath any content you add (so that the very last thing in your canvas page an <fb:iframe> tag with smartsize="true" set, then the smartsize code works fine - it's only if there is some spacing under the last <fb:iframe> tag that it breaks.
It would be nice if we were able to call the smartSizingFrameAdded() javascript function from the canvas, but it gets prefixed with our app id, which makes it a little useless.
[edit] GET Parameters not appended correctly?
It says that all the pertinent params (all the fb_sig stuff) are appended to the src="" string, but the string I get back are appended with "&" instead of just "&". This renders the variables useless. Smooth move Facebook.
[edit] Why is the src a required attribute?
There are some cases where you just want to add an empty iframe - if you're creating a pipe to submit a form through later or if you're using an iframe as a blocking element to keep scrollbars and dropdown menus from bleeding through absolutely positioned elements...
[edit] Content under iframe....
I found that unclosed tag <fb:iframe> clears any content under it. I.g. in this case "asdfgh" will never output.
<fb:iframe src="xxx" > asdfgh
I had to close tag to see content under iframe:
<fb:iframe src="xxx" /> asdfgh
[edit] That is as it should be
Leaving an unclosed iframe tag generally will have this effect
[edit] Does this work in FBML boxes on Facebook Pages?
Because it doesn't appear to. What's wrong with my code here?
<fb:iframe
/>
... are those Single-Quotes? ... I don't deal with HTML, so does this matter?
