<fb:iframe/>
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.
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.
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
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
width=[int
]
default: none
height=[int
]
default: none
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.
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"/>
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& src=true&notabs=1& fb_sig_in_iframe=1&fb_sig_time=1205793218.0177& fb_sig_added=0&fb_sig_user=683545112& fb_sig_profile_update_time=1205648428&fb_sig_session_key= 54aeab3103ef387539a31aa1-683545112& fb_sig_expires=0&fb_sig_api_key= ba19d367e2d8c4ea5813d54f2cbba136& fb_sig=61cce193ae9cdc2cb2e2858481ea8cc9" frameborder="1" width="500" height="100" style="margin: 10px;" scrolling="auto"> </iframe>
<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.
18.224.54.255