【问题标题】:How to get mouse click event in jquery over facebook like plugin?如何在 jquery 中通过 facebook 之类的插件获取鼠标点击事件?
【发布时间】:2011-05-25 06:02:48
【问题描述】:

点击 iframe 后,我在 iFrame 中调用 facebook like plugin 我想在我的 DOM 内容中执行一些脚本。

这里是 facebook 的代码,比如 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">

【问题讨论】:

    标签: jquery facebook jquery-selectors facebook-like


    【解决方案1】:

    这是here的回答。

    总结:为iframe绑定点击事件可以,但不能跨站。

    【讨论】:

      【解决方案2】:

      我建议你使用 Facebook 喜欢按钮的 fbml 版本。

      <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>
      

      你可以使用下面的代码来做你想做的事:

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

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-07-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多