1
我想解雇这个Facebook的事件,但它不工作?想实现一些视图跟踪,也许我有错误的方法?如何触发FB事件?
<!doctype html>
<html lang="en" xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<meta charset="utf-8">
<title>Facebook Like Button</title>
</head>
<body>
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({ appId: 'xxxx', status: true, cookie: true,
xfbml: true
});
FB.Event.subscribe('edge.create', function (href, widget) {
alert('Facebook Like'); // I would like to call some tracking functionality here but does not fire:(
console.log('like');
});
};
(function() {
var e = document.createElement('script'); e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<fb:like></fb:like>
</body>
</html>
你可以不像使用类似按钮。当你将鼠标悬停在它上面时,会出现一个小的“x”,它可以让你不同。 –