Facebook JavaScript SDK:FB.ui打开一个弹出窗口 [英] Facebook JavaScript SDK: FB.ui opens a popup window

查看:132
本文介绍了Facebook JavaScript SDK:FB.ui打开一个弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Facebook iframe应用中使用以下代码显示张贴到墙上"供稿对话框:

I am trying to show a 'Post to Your Wall' feed dialog with the following code in a facebook iframe app:

<div id="fb-root"></div>
  <script src="http://connect.facebook.net/en_US/all.js">
  </script>
  <script>
     FB.init({ 
        appId:'249725835046216', cookie:true, 
        status:true, xfbml:true 
     });

     FB.ui({ method: 'feed', 
        message: 'Facebook for Websites is super-cool',
        name: 'Facebook Dialogs',
        link: 'http://developers.facebook.com/docs/reference/dialogs/',
        picture: 'http://fbrell.com/f8.jpg',
        caption: 'Reference Documentation',
        description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'



        });
  </script>

问题在于它出现在新的弹出窗口中,如下所示:

The problem is that it is appearing in a new popup window like this:

与其像这样不显示而没有出现在弹出窗口中:

Instead of appearing as like this without appearing in a popup window:

我不希望Feed对话框出现在新的弹出窗口中,因为在大多数现代网络浏览器中,弹出窗口被阻止了.我不知道为什么会这样.请帮忙.

I don't want the feed dialog to appear in a new popup windows because in most modern web browsers where popups are blocked. I don't know why this is happening. Please help.

推荐答案

如果用户未授权您的应用程序,我很确定您会弹出一个弹出窗口.出于安全原因,Facebook使其以这种方式工作.如果您首先提示授权,则应该获得内联对话框.

I'm pretty sure that you get a popup if the user has not authorized your application. Facebook made it work that way for security reasons. If you prompt for authorization first, then you should get the inline dialog.

请注意,授权请求本身将是一个弹出窗口,但您只需要执行一次即可.我在Someecards Facebook应用程序中以您想要的方式以这种方式工作.随意获取JavaScript代码,它不是特定于应用程序的.

Note that the request for authorization will itself be a popup, but you only have to have that happen once. I have things working this way, the way you want, in the someecards Facebook app. Feel free to grab the javascript code, it's not specific to the app.

这篇关于Facebook JavaScript SDK:FB.ui打开一个弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆