我只是想测试有点测试页上一样的功能和我得到意外的行为后,立即关闭。当我点击类似按钮时,对话框(可以添加文本并贴到墙上的对话框)弹出约半秒,然后自行关闭。像按钮本身变成一个链接,说“确认”。我真的有这些骨头,不知道会出现什么问题。我正在使用FBML。这里是我的测试页面的完整代码:Facebook的Like按钮弹出的对话框中点击
<!DOCTYPE html>
<html>
<head>
<title>Facebook Like Test</title>
</head>
<body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId: 'myid',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
};
// Load the SDK Asynchronously
(function (d) {
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) { return; }
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
} (document));
</script>
<h1>Facebook Like Testing</h1>
<div>
<fb:like href = "http://www.example.com?id=1"></fb:like>
</div>
<div>
<fb:like href = "http://www.example.com?id=2"></fb:like>
</div>
<div>
<fb:like href = "http://www.example.com?id=3"></fb:like>
</div>
<div>
<fb:like href = "http://www.example.com?id=4"></fb:like>
</div>
</body>
</html>
我只是追加一个任意查询字符串,使hrefs唯一。这里可能会出现什么问题?
嗨,谢谢你的回应。不,我在输出中没有遇到任何错误。我的应用程序配置在“应用程序域”下有mydomain.com。我甚至尝试使用FB生成的代码,我仍然有这个问题。我很困惑,至少可以说。 – TheMethod
那么你是否在测试脚本时直接访问url“mydomain.com”?因为您的应用需要直接从您在Facebook的应用设置中设置的域中运行。您可以随时使用hosts文件。 –