Ricardo
Ricardo

Reputation: 1672

Any way to load a popup inside the iframe?

I'm wondering if i can do that, Basically what im trying to achieve is the facebook share block already turned on when the user comes to the page but facebook won't allow iframing it..

The idea is that the user will see the share window without clicking the initial share button this way they will only need to share it on facebook's share box without the need to click share twice.

I was just thinking about the idea and how it could help while making the share function popup-less and to show the share prompt when the document loads and not whenever a user clicks share and will be glad if that can be achieved.

I has the idea of the share popup automatically open inside an iframe but i have no idea if that can be done.

Upvotes: 0

Views: 876

Answers (2)

Moustafa Samir
Moustafa Samir

Reputation: 2268

To display popup inside iframe you've to set "display: 'iframe'" and you've to set the access token that you got by authentication You can also view errors by using "show_error:true"

FB.ui({ 
 method: 'apprequests', 
 message: 'Facebook for Websites is super-cool',
 display: 'iframe',
 show_error:true,
 access_token: '#{@access_token}'
 });

Upvotes: 1

Juicy Scripter
Juicy Scripter

Reputation: 25918

You can use Feed Dialog with FB.ui (JS-SDK) to achieve sharing dialog that can be displayed within your application canvas (which is running within iframe).

You can also use regular pop-up window. Most browsers blocking pop-ups if opened not by user interaction like click, but form submit is also considered user interaction in most cases, so submitting a form with target attribute pointing to invisible iframe will allow you to open popup on submit event...

Upvotes: 0

Related Questions