【发布时间】:2013-05-27 13:34:24
【问题描述】:
我想调查 facebook 登录如何将数据传输到主页 (mypage) - 尽管存在跨域边界限制。
于是我用FB js sdk 代码创建了一个新页面:
FB.login(function (response)
{
if (response.authResponse)
{...
它确实打开了弹出窗口:
但是当我调查查看是否有任何 iframe 在我的页面上(我的代码不包含任何 iframe):
我看到了这个:
>>$("iframe")
结果:
[
<iframe name="fb_xdm_frame_http" frameborder="0" allowtransparency="true" scrolling="no" id="fb_xdm_frame_http" aria-hidden="true" title="Facebook Cross Domain Communication Frame" tab-index="-1" src="http://static.ak.facebook.com/connect/xd_arbiter.php?version=24#channe…l_path=%2FWebSite2%2FHTMLPage3.htm%3Ffb_xd_fragment%23xd_sig%3Df5252874%26" style="border: none;">…</iframe>
,
<iframe name="fb_xdm_frame_https" frameborder="0" allowtransparency="true" scrolling="no" id="fb_xdm_frame_https" aria-hidden="true" title="Facebook Cross Domain Communication Frame" tab-index="-1" src="https://s-static.ak.facebook.com/connect/xd_arbiter.php?version=24#cha…l_path=%2FWebSite2%2FHTMLPage3.htm%3Ffb_xd_fragment%23xd_sig%3Df5252874%26" style="border: none;">…</iframe>
]
我读到它们是用于跨域的。
但问题是为什么他们在我的页面上?
他们应该在 facebook 内部页面的某个地方!
我这么说是因为我知道 Iframe 技术 是这样工作的:
如您所见 - 内部 iframe 创建 another iframe,其中包含来自查询字符串的 SRC 值(该值实际上是首页 url),然后,在两个页面上都使用 JS + URL => JS触发函数,我们可以这样做:
top.sendData({...})
我错过了什么?
- 数据如何从 FB 登录传递到我的页面?
【问题讨论】:
标签: javascript facebook cross-domain facebook-javascript-sdk