Name
<fb:ref/>
Synopsis
<fb:ref [url="..."|handle="..."]/>
Allows the developer to reference FBML, whether it be
from Facebook’s servers or an external URL. When
handle is used, Facebook references a cached
handle stored on the Facebook
servers that is set via the fbml.setRefHandle API
method. When url is used, Facebook
references FBML retrieved from a URL that you specify that it has
cached on its servers. With url, you have to use
the fbml.refreshRefUrl API method.
FBML-Specific Attributes
Required
url=[string] default: noneThe URL of the content to be loaded. Whenever this tag is called with that URL, the content originally cached on Facebook’s servers will be loaded in place. This is a great way to dynamically load content onto a user’s profile. You must specify either
urlorref, but not both.ref=[string] default: noneThe
refhandle that points to data that was previously stored via the API method call,fbml.setRefHandle. Whenever this tag is called for thatrefhandle, that content will be loaded. This keeps you from having to continuously load data from your servers. It is also an excellent way to dynamically load content into a user’s profile. You must specify eitherurlorref, but not both.
Optional
None.
Example FBML
Two examples follow. Imagine these placed on a user’s profile. (They work on the canvas page as well.)
First, assuming you made the API call:
fbml.setRefHandle("test_handle","Hello <fb:name uid='loggedinuser'/>");then, anywhere you load:
<fb:ref ref="test_handle"/>
will ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access