如何使用 php SDK 在弹出窗口中显示 facebook 授权窗口?
我想在弹出窗口中显示授权窗口,但这似乎不起作用
getLoginUrl(array('scope' => 'read_stream,publish_stream','display' => 'popup'));< /code>
仅使用 php SDK 可以吗?
I want to display authorization window in popup, however this doesn't seem to be working
getLoginUrl(array('scope' => 'read_stream,publish_stream','display' => 'popup'));
Is it possibble with just php SDK?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只有客户端决定页面的加载位置(例如:自己的窗口、父窗口、顶部窗口、弹出窗口),服务器端无法控制或知道这一点。
要打开弹出窗口,您必须调用
window.open()
(查找)。如果你确实想做服务器端oauth,你可以在php中使用getLoginUrl()
并将其存储在页面中(javascript var / data- attribute等),然后调用window.在正确的时间打开
,在弹出窗口中打开登录网址。但是,您不能随心所欲地打开弹出窗口——您会被阻止。因此,您需要添加一个“登录”链接供用户单击,并为该单击添加一个将打开弹出窗口的事件处理程序。
Only the client side determines where a page gets loaded (for instance: own window, parent window, top window, popup), server side doesn't control or know about that.
To open a popup window you have to call
window.open()
(look it up). If you do want to do server-side oauth, you cangetLoginUrl()
in php and store it in the page (javascript var / data- attribute, etc.) and then callwindow.open
at the right time to open the login url in a popup.However, you can't just open a popup whenever you want --you'll get blocked. So you'll need to add a "login" link for the user to click on, and an event handler for that click that will open the popup.