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: none

The 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 url or ref, but not both.

ref=[string] default: none

The ref handle that points to data that was previously stored via the API method call, fbml.setRefHandle. Whenever this tag is called for that ref handle, 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 either url or ref, 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 display:

Hello <fb:name uid='loggedinuser'/>

Alternatively, if http://fbmlessentials.staynalive.com/ref.php were to contain:

Example url usage of &lt;fb:ref/&gt;

then, if you called the following on a canvas or profile page:

<fb:ref url="http://fbmlessentials.staynalive.com/ref.php"/>

this tag would be rendered as the following HTML:

Example url usage of &lt;fb:ref/&gt;

Additional Information

  • Nested <fb:ref/>s are allowed.

Now that you’ve made it this far, let’s spend some time learning a little about FBJS, Facebook’s own set of JavaScript libraries, in Chapter 4.

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

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