gpt4 book ai didi

javascript - 我如何知道用户何时点击了 Facebook 点赞按钮?

转载 作者:行者123 更新时间:2023-11-29 10:20:59 25 4
gpt4 key购买 nike

我尝试实现“赞”按钮以及一些在点赞该页面时触发的代码,但我无法使其正常工作。

当我喜欢这个页面时,FIrebug 显示这个错误:

Event.__inlineSubmit is not a function

除了我喜欢的页面之外,没有任何反应(即没有警报/重定向/其他)。到目前为止的代码:

<div id="fb-root"></div>

<script type="text/javascript">
<!--
window.fbAsyncInit = function () {
FB.init({ appId: '---MYAPPID---', status: true, cookie: true, xfbml: true });
FB.Event.subscribe('edge.create', function (href, widget) {
// track the click on the "Like" button here
alert(href);
});
};
(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>

<div class="fb-like" data-send="false" data-layout="box_count" data-width="60" data-show-faces="false"></div>

最佳答案

http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

FB.Event.subscribe('edge.create',
function(response) {
alert('You liked the URL: ' + response);
}
);

关于javascript - 我如何知道用户何时点击了 Facebook 点赞按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12129484/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com