Name

<fb:iframe/>

Synopsis

<fb:iframe src="..."/>

An excellent tool when you need to render complex JavaScript, Flash, or unsupported FBML. This tag links to an external web address and renders the content from that URL inside an HTML <iframe/> tag on the canvas page. From the external URL, any HTML, JavaScript, or Flash may be used, but keep in mind that content will not be parsed by Facebook, and therefore FBML will not be supported for anything output by the <fb:iframe/> tags. <fb:iframe/> is not supported on user profile pages.

FBML-Specific Attributes

Required

src=[string] default: none

External URL (non-Facebook, e.g., your own servers) to render in the iframe. All Facebook variables mentioned in the Forms in FBML” section in Chapter 2 are appended to this URL, including fb_sig_profile, fb_sig_user, fb_sig_session_key, fb_sig_time, and fb_sig, in addition to an fb_sig_in_iframe parameter to let the app know it is being called from an iframe.

Optional

smartsize=[true|false] default: false

If true, automatically fits the iframe to the remaining space on the page and disables the scrollbars.

frameborder=[1|0] default: 1

If 1, shows the iframe border. If 0, hides it.

scrolling=[yes|no|auto] default: yes

If yes, displays scrollbars. If no, doesn’t display scrollbars. If auto, scrollbars are displayed only if the enclosed content exceeds the size of the iframe.

style=[string] default: none

Specifies the style for the iframe.

width=[int] default: none

Specifies the width of the iframe.

height=[int] default: none

Specifies the height of the iframe.

resizable=[true|false] default: false

If true, allows the containing site to control the outer iframe’s size via JavaScript. Cannot be used when smartsize is true. You must also specify a name attribute when using the resizable attribute. Please see Chapter 4 for more functional examples that show how to do this.

name=[string] default: none

Name for the iframe. For use when resizable="true", and enables access via JavaScript from the containing site.

Example FBML

Here is example FBML code for <fb:iframe/>:

<fb:iframe src="http://fbmlessentials.staynalive.com/?action=
    iframe&src=true& notabs=1" frameborder="1" width="100" 
    height="100" style="margin:10px" scrolling="auto"/>

Rendered HTML for Single Instance of Tag

The generated <fb:iframe/> tag for the example looks like this (Figure 3-21 shows the result):

<iframe 
  src="http://fbmlessentials.staynalive.com/?action=iframe&amp;
        src=true&amp;notabs=1&amp;
    fb_sig_in_iframe=1&amp;fb_sig_time=1205793218.0177&amp;
        fb_sig_added=0&amp;fb_sig_user=683545112&amp;
    fb_sig_profile_update_time=1205648428&amp;fb_sig_session_key=
        54aeab3103ef387539a31aa1-683545112&amp;
    fb_sig_expires=0&amp;fb_sig_api_key=
        ba19d367e2d8c4ea5813d54f2cbba136&amp;
    fb_sig=61cce193ae9cdc2cb2e2858481ea8cc9" 
    frameborder="1" 
    width="500" 
    height="100" 
    style="margin: 10px;" 
    scrolling="auto">
</iframe>
The result of our <fb:iframe/> example
Figure 3-21. The result of our <fb:iframe/> example

Additional Information

  • <fb:iframe/> works only on canvas pages. It will not work on a user’s profile page.

  • Be sure to use your own external, non-Facebook URL—i.e., the callback URL you specified in your application settings—for the src. If you don’t, the iframe will wrap the Facebook look and feel.

  • FBML is not supported within the iframe.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.54.255