我有这段代码,我从 facebook 上的官方教程中获得
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div id="fb-root">sei qui</div>
<script>
window.fbAsyncInit = function() {
// init the FB JS SDK
FB.init({
appId : '173721946132851', // App ID from the app dashboard
channelUrl : '//www.ilmiobloggo.net/LOVECALCULATOR/index.php', // Channel file for x-domain comms
status : true, // Check Facebook Login status
xfbml : true // Look for social plugins on the page
});
// Additional initialization code such as adding Event Listeners goes here
};
// Load the SDK asynchronously
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
FB.api('/me', function(response) {
alert('Your name is ' + response.name);
});
</script>
</body>
</html>
但是 FB.api 不起作用,我不明白为什么,有人可以帮我。我试图获取我家主机的 Apache 日志错误,但没有。