I am trying to create a dialog box for my Facebook IFRAME application which I then can close programmatically via Javascript. I cannot create the dialog via a Javascript library such as jQuery because I need to embed a particular FBML tag within the dialog.
Approach 1: Via the current Javascript SDK. This doesn't provide me with any way to close it except by clicking the X button.
<script type="text/javascript">
var content = .... // my fbml content
var dialog = {
method:'fbml.dialog',
display: 'dialog',
fbml: content,
};
FB.ui(dialog);
</script>
Approach 2: Via XFBML and a whole lot of divs and css to imitate a FB dialog box. However, I can't seem to add Javascript inside the serverfbml tags which means there's no way to programmatically show or hide it.
<fb:serverfbml>
<script type="text/fbml">
<fbml>
<div> .... </div>
</fbml>
</script>
</fb:serverfbml>
Are there any approaches that can possibly create such a dialog box?