Name

<fb:dialog/>

Synopsis

<fb:dialog id="...">...<fb:dialog-content>...</fb:dialog-content></fb:dialog>

Creates an AJAX-based, pop-up dialog box that appears when a specified element on the page is clicked. The dialog box can contain any specified content, and uses Mock AJAX to refresh itself with new content.

FBML-Specific Attributes

Required

id=[string] default: none

The ID of the dialog box. When an element that has the clicktoshowdialog attribute is clicked, this tag looks for this ID and displays the dialog box if the IDs are equal.

Optional

cancel_button=[true|false] default: false

If true, displays a cancel button in the dialog box.

Required included tags

  • <fb:dialog-content/>, described later in this chapter.

Optional included tags

  • <fb:dialog-title/>, described later in this chapter.

  • <fb:dialog-button/>, described later in this chapter.

Example FBML

The following <fb:dialog/> instance launches a dialog box on the submission of a form that has two buttons:

<fb:dialog id="my_dialog" cancel_button="true">
  <fb:dialog-content>Do you want to go to my blog?</fb:dialog-content>
  <fb:dialog-title>This is the &lt;fb:dialog/&gt; box.</fb:dialog-title>
  <fb:dialog-button type="button" value="Yes" href="http://staynalive.com"/>
  <fb:dialog-button type="button" value="No" 
      href="http://apps.facebook.com/fbmlessentials"/>
</fb:dialog>
<p><a href="#" clicktoshowdialog="my_dialog">Click here to display the 
    dialog...</a></p>

Rendered HTML for Single Instance of Tag

When you click the link shown in Figure 3-39...

The link that results from our <fb:dialog/> example
Figure 3-39. The link that results from our <fb:dialog/> example

…the dialog box shown in Figure 3-40 pops up on the page.

The dialog box
Figure 3-40. The dialog box

Additional Information

  • For more flexibility in producing dialog boxes in Facebook, use the Dialog class in FBJS (see the Dialogs” section in Chapter 4).

  • See the <fb:dialogresponse/> tag for posting information from the submitted dialog back into the same dialog box (i.e., you want to keep the dialog box open but show new information based on what the user clicks).

  • This tag is in beta at the time of this writing.

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

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