0

I have a pop-up contains like button. If people liked it, it will disappear forever. How can I check that ? Thanks you for helping hand.

4

1 回答 1

2

请尝试此代码。

 <fb:like  href="https://www.facebook.com/your.page"  show_faces="false" layout="button_count" width="50" action="like" colorscheme="light" font="trebuchet ms"></fb:like>




<div id="fb-root"></div>
<script type="text/javascript">
<!--
window.fbAsyncInit = function() {
// Don't use my app id, use your own or it won't work!
 FB.init({appId: '576586756757658765', status: true, cookie: true, xfbml: true});
 FB.Event.subscribe('edge.create', function(href, widget) {
 // Do something, e.g. track the click on the "Like" button here

jQuery(document).ready(function(){
 $.ajax({
  url: 'http://www.yourdomain.com/update_fblike',
  success: function(data) { 
 if(data == "1"){
    window.location.href = '/thankyou';
    }  }
});
 });





 });
};
(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>

更多信息 - http://www.saschakimmel.com/2010/05/how-to-capture-clicks-on-the-facebook-like-button/

于 2013-05-29T03:49:26.077 回答