XFBML을 통해 렌더링되는 버튼과 같은 여러 페이스 북이 있습니다. 버튼을 클릭하면 버튼과 같은 표준에서 "당신이 마음에 드는"아이콘으로 변경된다는 점에서 효과가있는 것으로 보입니다. 그러나 2 ~ 2 초 후 (FB 서버를 치고 다시 돌아 오는 데 걸리겠다고 가정), 자동으로 버튼을 원래대로 되돌려 놓습니다.버튼처럼 페이스 북은 자동으로 실행 취소됩니다.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml" lang="en">
...
<fb:like href="http://www.example.com/valid/path" layout="button_count" ref="recipe_preview" />
...
<script type="text/javascript">
window.fbAsyncInitExt = function() {
FB.Event.subscribe('edge.create', function(response) {
alert('Facebook Like Button: ' + response);
});
};
</script>
...
<div id="fb-root"></div>
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({
appId: 'XXXXXXXXXX', // my app ID is here
status: true,
cookie: true,
xfbml: true
});
if (typeof(fbAsyncInitExt) == 'function') {
fbAsyncInitExt();
}
};
(function() {
var e = document.createElement('script');
e.type = 'text/javascript';
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
})();
</script>
편집 : 그것은 가치가 무엇인지에 대한는 또한 페이스 북은 모든 로그 정보를 전송하고 있는지 확인하기 위해 시도하지만,이 나타나지 않았다
See a video of what I mean here.
내 코드는 꽤 표준입니다 다음과 같습니다 :
<script type="text/javascript">
window.fbAsyncInitExt = function() {
FB.Event.subscribe('edge.create', function(response) {
alert('Facebook Like Button: ' + response);
console.debug(response);
});
FB.Event.subscribe('fb.log', function(response) {
alert('LOG: ' + response);
console.debug(response);
});
};
</script>
당신은 내 문제를 해결 한 opengraph 문서의 페이지입니다. 감사합니다. :) –
대단히 감사합니다. 나는 미쳐 가고 있다고 생각했습니다! – Matt