我想知道如何用自定义超链接替换('like '+href)。 例如:“感谢您喜欢我们。访问 example.com”
<html>
<body>
<fb:like href="http://www.example.com/" show_faces="true" width="450"></fb:like>
<div id="fb-root"></div>
<script src="http://connect.facebook.net/it_IT/all.js#xfbml=1"></script>
<script>
FB.Event.subscribe('edge.create', function(href, widget) {
alert('like '+href);
});
FB.Event.subscribe('edge.remove', function(href, widget) {
alert('dislike '+href);
});
</script>
</body>
</html>
最佳答案
如果您只想这样做,只需将字符串'like '+href
替换为'感谢您喜欢我们的页面,请访问我们的网站whatever.com'
- 否则不清楚你在问什么。
如果您想重定向用户,只需使用标准 javascript 重定向来代替 alert();
调用或在该调用之后的行
关于facebook - FB.Event.subscribe 类似按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7859921/