Dialogs
Besides the <fb:dialog/> FBML tag,
you can also use FBJS to render dialogs. FBJS dialogs give you slightly
added flexibility that you don’t get from FBML. The way to initiate a
dialog box is simply by instantiating a new Dialog
object via the DOM. The following are the methods supported by the
Dialog class:
Dialog(type)The constructor for
Dialog. Note thattypecan be one of eitherDialog.DIALOG_POPorDialog.DIALOG_CONTEXTUAL:Dialog.DIALOG_POPRenders a dialog box that looks like Figure 4-1.
Dialog.DIALOG_CONTEXTUALRenders a dialog box that looks like Figure 4-2.

Figure 4-1. DIALOG_POP

Figure 4-2. DIALOG_CONTEXTUAL
onconfirmEvent handler that gets triggered when the leftmost button is clicked in the dialog.
oncancelEvent handler that gets triggered when the rightmost button is clicked in the dialog.
setStyleSets the style of the parent dialog box.
showMessage(title, content, button_confirm = 'Okay')Renders a dialog box with just one confirm button, similar to an “alert” box. The title and content can be either pure text or FBML content using a variable from something like <fb:js-string/>.
showChoice(title, content, button_confirm = 'Okay', button_cancel = 'Cancel')Renders a dialog box with both a confirm and a cancel button. The title and content can be either pure text or FBML content ...
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