Creating a Popup Dialog in an IFrame

From Facebook Developer Wiki

Jump to: navigation, search

If you've made an iframe-based application (where your application's canvas page is actually an iframe rendering content from your servers), you can create popup dialogs through the following JavaScript and FBJS calls. This way, you can create Feed dialogs through JavaScript, and not use FBML.

Next, include the following snippet with your code (which you should put in place of <YOUR CODE HERE>). You need to reference:


<script src="http://static.ak.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script> <script type="text/javascript"> FB_RequireFeatures(["XFBML"], function(){ FB.Facebook.init(<application API key>, <site relative URL to xd_receiver.htm>, null); <YOUR CODE HERE> }); </script>


You call the following functions:

Note: The target_id parameter allows for the Feed dialog to publish to one friend's feed. In order for an iframe application to publish Feed stories to multiple friends' Feeds, use the multiFeedStory form within fb:serverfbml tags.


See Also

reference