在按钮上显示提醒点击 [英] Show alert on a button click

查看:110
本文介绍了在按钮上显示提醒点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用默认的Facebook嵌入代码:

I'm using the default Facebook embed code:

<div id="fb-root"></div> 
<script src="http://connect.facebook.net/en_US/all.js#appId=176702405718664&amp;xfbml=1"> </script>
<fb:like href="http://domain.com" send="true" width="700" show_faces="false" action="recommend" font=""></fb:like>

..但如果用户点击推荐或发送,我想显示一个提醒' 纽扣。请看这个小提琴:

.. but I'd like to show an alert if the user clicks 'recommend' or 'send' buttons. Please see this fiddle:

http://jsfiddle.net/4wB9x/1 /

谢谢!

推荐答案

订阅edge.create事件,当用户点击相似的按钮时,它被触发。

you will have to subscribe to the edge.create event, it gets triggered when user clicks the like button.

FB.Event.subscribe('edge.create',
function(response) {
    alert('You liked the URL: ' + response);
   }
);

//发送时,您将不得不使用此

// for send you will have to use this

 FB.Event.subscribe('message.send',
function(response) {
    alert('You sent the URL: ' + response);
   }
); 

这篇关于在按钮上显示提醒点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆