Facebook FB.UI simple alert dialog
is it possible to make simple alert dialog (like JS alert) with FB.ui?
Can you give a small example?
Your help would be appreci开发者_StackOverflow中文版ated.
There is a good thread about this on the Facebook forum. The code mentioned is:
function popup(){
FB.ui({
method: 'fbml.dialog',
width:500,
height:400,
fbml: '<fb:header icon="true" decoration="add_border">Title here...</fb:header>' +
'<div style="width:100%; height:100%;" align="center">' +
'<div style="margin:15px;">Do you wish to continue?</div>' +
'<label class="uiButton uiButtonLarge uiButtonConfirm"><input type="button" name="OK" value="OK"></label>' +
'<label class="uiButton uiButtonLarge uiButtonConfirm"><input type="button" name="Cancel" value="Cancel"></label>' +
'</div>',
});
}
The newer Javascript SDK doesn't support this in an iFrame app, but this would work if you are still using an FBML page. Otherwise, you will need to build your own or use one that has already been built such as LightFace or Freebox.
It is not possible to create dialogs this way anymore. I have created a simple jQ "plugin" to create FB-like looking alerts, you can download it on my github: https://github.com/marekjalovec/jquery-facebook-alert
精彩评论