我正在为Facebook创建框架应用程序。 下面的代码工作对我好:Facebook api只为我工作
function changeToHome() {
try {
var time = new Date();
FB.api("/me", {fields: "id,first_name,last_name,picture"}, function(response)
{
window.location = '#home';
var fname = encodeURIComponent(response.first_name);
var lname = encodeURIComponent(response.last_name);
var avatar = encodeURIComponent(response.picture.data.url);
var u = '?useradd='+response.id+"&fn="+fname+"&ln="+lname+"&p="+avatar+"&t="+time.getTime();
document.getElementById('game_frame').src=('drop.html'+u);
$.ajax({
url: 'stat-api.php'+u
}).done(function() {
//alert("done");
});
});
} catch(ex) {
//alert(ex);
}
}
但如果我尝试测试它trought其他acounts Facebook的API不起作用(我尝试不同的浏览器,得到了相同的结果
是您的应用发布了吗?在您的应用程序正在开发中时,您需要将人员添加到测试人员组中。你可以从https://developers.facebook.com/apps – 2013-04-11 16:53:36
这样做。我有两个测试人员。他们都无法正常使用应用程序。对于他们“回复”是不明确的:( – 2013-04-11 17:02:26
你应该发布你的解决方案作为回应,以便它与SO上其余的解决问题更好地配合。 – 2013-04-17 13:36:04