I m trying to use SDK Facebook to detect the click on the button "like" of the likebox and call a function , but it not working . Here s my code :
<!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" xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
</body>
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : xxxx , // App ID
channelURL : xxxx/facebook/channel.html , // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// 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>
<script type="text/javascript">
FB.Event.subscribe( edge.create ,
function(response) {
alert( You liked the URL: + response);
}
);
</script>
<fb:like-box href="http://www.facebook.com/MarwenClubiiste" width="292" show_faces="false" stream="false" header="false"></fb:like-box>
</html>
请帮助,我确实需要这样做。