开发者

How to get mouse click event in jquery over facebook like plugin?

Here I am calling facebook like plugin in iFrame after click in that iframe I want to perform some script in my DOM content.

Here code for facebook like plugin for iframe

<iframe id="test" src="http://www.facebook.com/plugins/like.php? 
       href=http://yoururl.com/&amp;
       layout=button_count&amp;
       show_faces=false&amp;
       width=50&amp;
       action=like&amp;
       colorscheme=light&amp;
       height=21" 
       scrolling="no" frameborder="0" 
       style="border:none; over开发者_如何学Goflow:hidden; width:50px;  
              height:21px;" 
       allowTransparency="true">


This is answered here.

Summary: Binding click events for iframes can be done, but not cross-site.


I suggest you use the fbml version of the Facebook like button.

<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="" send="false" width="450" show_faces="false" font=""></fb:like>

And you can use the following code to do what you want:

FB.Event.subscribe('edge.create', function(response) {
  // perform some script in your DOM content 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜