开发者

How does one create a dialog box for Facebook IFrame applications that can be closed programmatically?

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> .... &开发者_C百科lt;/div>
      </fbml>
   </script>
</fb:serverfbml>

Are there any approaches that can possibly create such a dialog box?


Create a standard dialog box that includes your FBML. Call XFBML.Parse() when you open your dialog and it should work fine. If you need a leg up with a reasonable dialog jQuery control, Boxy is pretty good.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜