2

is it possible to make simple alert dialog (like JS alert) with FB.ui?

Can you give a small example?

Your help would be appreciated.

Bounce
  • 2,066
  • 6
  • 34
  • 65
  • Can you give a more precise example of what exactly you are trying to do? – Niklas Jun 23 '11 at 10:01
  • Im trying to change JS alert('message'), to facebook alert style window. But I guess to use FB.ui for this purpose it is not good. – Bounce Jun 23 '11 at 11:50
  • 1
    I've used LightFace - Facebook Lightbox for MooTools. It really does the job done. http://davidwalsh.name/facebook-lightbox – Bounce Jun 23 '11 at 13:57

2 Answers2

1

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

Marek Jalovec
  • 1,427
  • 11
  • 12
1

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.

bkaid
  • 51,465
  • 22
  • 112
  • 128