【发布时间】:2011-08-29 23:12:15
【问题描述】:
我正在尝试在我网站的页面上放置一个 Facebook Like-Box,然后通过我自己的 CSS 对其进行样式设置(主要是为了增加授予 div#stream_content 的高度。(这个想法是让 FB 提要行为作为新闻提要,但我不希望用户必须滚动才能看到更多前两项或默认情况下的内容)。
我已阅读并尝试了这些文章中的建议以及更多内容:
http://stackoverflow.com/questions/4064038/customizing-facebook-like-box,
http://www.daddydesign.com/wordpress/how-to-customize-your-facebook-fan-box/,
http://hitech-tips.blogspot.com/2010/05/facebook-like-button-xfbml-tutorial.html
我将采用 FBML 路线(而不是使用 iframe),因为我收集到应用跨域样式表是必需的。我还发现我的网页需要这个 doctype 声明:<!doctype html lang="en" xmlns:fb="http://www.facebook.com/2008/fbml" xml:lang="en">
那么我在页面正文中有这个:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like-box
profile_id="***my ID here***"
width="450"
height="600"
colorscheme="dark"
show_faces="false"
stream="true"
header="false"
logobar="0"
css="http://***my domain here***/css/FBstyles.css?1"
href="http://www.facebook.com/***my page name here***"
></fb:like-box>
但我仍然遇到这些错误:
“(4) 不安全的 JavaScript 尝试访问带有 URL 的框架...(我的网页)...从带有 URL http://www.facebook.com/plugins/likebox.php?channel=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D2%23cb%3Dfd907a0e%26origin...blahblahblah 的框架。域、协议和端口必须匹配。”
我在哪里搞砸了?
【问题讨论】:
标签: css facebook embed embedding