2

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; overflow:hidden; width:50px;  
              height:21px;" 
       allowTransparency="true">
ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
Yashwant Kumar Sahu
  • 3,356
  • 7
  • 27
  • 42

2 Answers2

2

This is answered here.

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

Community
  • 1
  • 1
awendt
  • 13,195
  • 5
  • 48
  • 66
2

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 
});
Billy
  • 15,516
  • 28
  • 70
  • 101