Facebook IFrame 在页面画布上?
大家好,我开发了一个小网站,我想将其嵌入 Facebook 页面的选项卡中。
以前我使用此代码在 iframe 中加载,效果很好:
<a onClick="outside_location.setInnerFBML(link_1);" style="cursor: pointer;">Link 1</a> | <a class="red" onClick="outside_location.setInnerFBML(link_2);" style="cursor: pointer;">Link 2</a>
<div id="outside_location"></div>
<fb:js-string var="link_1"><fb:iframe width="760" height="1280" frameborder='0' src='http://www.WebWhispers.in' /></fb:js-string>
<fb:js-string var="link_2"><fb:iframe width="760" height="1280" frameborder='0' src='http://google.com/' /></fb:js-string>
<script type="text/javascript" charset="utf-8">
var outside_location = d
document.getElementById('outside_location');
</script>
但是,它已停止工作。我不认为 facebook 允许在页面内使用 iframe,只允许在应用程序中使用。
在不学习 FBML 的情况下如何加载此页面?该网站使用 Jquery,所以我无论如何都不能使用 FBML。
我知道应用程序可以使用 iFrame,我可以将其设为应用程序,然后以某种方式将应用程序嵌入到页面选项卡中吗?
Hey guys, I have developed a small site that i would like to embed into a tab on a facebook page.
Previously I used this code to load in an iframe, it worked great:
<a onClick="outside_location.setInnerFBML(link_1);" style="cursor: pointer;">Link 1</a> | <a class="red" onClick="outside_location.setInnerFBML(link_2);" style="cursor: pointer;">Link 2</a>
<div id="outside_location"></div>
<fb:js-string var="link_1"><fb:iframe width="760" height="1280" frameborder='0' src='http://www.WebWhispers.in' /></fb:js-string>
<fb:js-string var="link_2"><fb:iframe width="760" height="1280" frameborder='0' src='http://google.com/' /></fb:js-string>
<script type="text/javascript" charset="utf-8">
var outside_location = d
document.getElementById('outside_location');
</script>
However, it has stopped working. I dont think facebook allows iframe inside of pages, only applications.
How can I load this page in without learning FBML? The site uses Jquery so I cant use FBML anyway.
I know applications can use iFrames, can I make it an application and then embed the application into a page tab somehow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以。选项卡页面不能包含 iFrame。它们必须使用 FBML 和 FBJS 编写。
原因之一是 Facebook 不希望启用标签页来检测谁在查看它们。因此,选项卡页面上的所有请求(包括图像)都通过 Facebook 进行代理。如果允许 iframe,那么应用程序将能够检测谁查看了它,这会给 Facebook 用户带来隐私问题。
No. Tab pages can not contain iFrames. They must be written using FBML and FBJS.
One reason for this is that Facebook does not want to enable Tab pages to detect who looks at them. All requests (including images) on tab pages are proxied through Facebook for this reason. If iframes were allowed then the application would be able to detect who looked at it, which would present a privacy issue for Facebook users.
这要么是 Facebook 的政策变更,要么更有可能是一个错误。我说这不太可能是策略更改,因为它会引发脚本错误,而策略更改更有可能在渲染之前将代码删除。
有您可以在此处添加投票并关注的错误报告。
This is either a policy change by Facebook or, more likely, a bug. I say it's unlikely to be a policy change as it throws a script error, whereas a policy change would more likely strip the code out before it's rendered.
There's a bug report you can add votes to and follow here.