相关疑难解决方法(0)

将click()事件附加到FaceBook"赞"按钮?

当用户点击"赞"时,我想在页面上执行某些操作.

我觉得像下面这样简单的东西会起作用:

<script type="text/javascript">
    $(document).ready(function () {

        $('.connect_widget_like_button clearfix like_button_no_like').live('click', function () {
            alert('clicked');
        });
    });
</script>
Run Code Online (Sandbox Code Playgroud)

这是FaceBook提供的iFrame,用于向页面添加Like按钮:

<iframe 
    id="FBLike"
    src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.MySite.Com... blahblahblah" 
    scrolling="no" 
    frameborder="0" 
    style="border:none; overflow:hidden; width:450px; height:80px;" 
    allowTransparency="true">
</iframe>
Run Code Online (Sandbox Code Playgroud)

我的脚本尝试将单击事件绑定到加载页面时加载到iFrame中的锚标记.它不起作用.有什么办法可以让jQuery在点击它时识别出来吗?谢谢

html iframe jquery facebook

22
推荐指数
2
解决办法
4万
查看次数

标签 统计

facebook ×1

html ×1

iframe ×1

jquery ×1