我的代码是
jQuery(window).load(function(){
jQuery("#myDiv").jcFacebookLike({href:"http://www.facebook.com/jaspreetchahal.org",
show_faces:"false",
layout:"button_count",
callbackLike:function(response) {
jQuery("#log").append(jQuery("<div></div>").html("Liked: "+response));
},
callbackUnLike:function(response) {
jQuery("#log").append(jQuery("<div></div>").html("Un-Liked: "+response +" - <hr>Please think about your decision again. If this plugin could be a help then keep liking my FB page. I have got lot to share :)"));
}
});
})
</script>
这是为了捕捉喜欢和不喜欢的事件,
和fb默认初始化,问题是当用户第一次点击,并通过fb帐户授权,回调不起作用,之后,当用户不喜欢所有回调工作正常。
这是示例
http://jaspreetchahal.org/examples/jquery-examples/likes/jcFacebookLike.html