Facebook Like 按钮不适用于子域
因此,我已经获得了子域 dot sitename dot com 的 Facebook 应用程序 ID,在 javascript 和页面底部的其他内容中弹出,并将按钮放入网站上我想要的位置。 “赞”按钮出现,表明我是 Facebook 用户。精彩的。
但是,当我单击“喜欢”按钮时,它不是喜欢 subdomain.sitename.com/blah,而是“喜欢”www.sitename.com/blah,从而给出错误。
我已硬编码 http://subdomain.sitename.com ,使用设置为 http:// subdomain 的变量dot sitename.com 等。无论我做什么,它都会以某种方式更改为 www dot sitename.com/blah
所以“like”按钮不起作用。关于可能出现的问题有什么建议吗?即使当我使用 Facebook 的 lint 时,它仍然会抛出异常错误,说 www.sitename.com/blah 不起作用。
$facebooksite 包含子域 dot sitename dot com。其余的是特定视频的链接。但由于某种原因,它仍然将 $facebooksite 更改为 www dot sitename dot com
代码如下:
<script src="connect.facebook.net/en_US/all.js#xfbml=1"></… href="<?php echo $facebooksite; ?>/video/<?php echo $_GET['id']; ?>" font="lucida grande" show-faces="false" width="300"></fb:like
So I've got my Facebook app ID for subdomain dot sitename dot com, popped in the javascript and whatnot at the bottom of the page and threw in the button where I want it on the site. The Like button shows up, recognizes me as a Facebook user. Wonderful.
But when I click on the "Like" button, instead of liking subdomain.sitename.com/blah, it "Likes" www.sitename.com/blah, thus giving an error.
I've hardcoded http://subdomain.sitename.com in, used a variable set to http:// subdomain dot sitename.com, etc. Regardless of what I do, it's somehow changed to www dot sitename.com/blah
So the like button doesn't work. Any suggestions on what the problem may be? Even when I use Facebook's lint it still throws up an exception error, saying www.sitename.com/blah doesn't work.
$facebooksite contains the subdomain dot sitename dot com. The rest is the link to a particular video. Yet for some reason, it still changes $facebooksite into www dot sitename dot com
Code here:
<script src="connect.facebook.net/en_US/all.js#xfbml=1"></… href="<?php echo $facebooksite; ?>/video/<?php echo $_GET['id']; ?>" font="lucida grande" show-faces="false" width="300"></fb:like
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
原来我的问题出在元标记中,由于某种原因设置为显示 www.sitename.com。我改变了它们,现在一切都运行顺利。
Turns out my problem was in the meta tags, which were set to display www.sitename.com for some reason. I changed them and now everything's running smoothly.