[英]How can I display a popup window with a message after a user clicks the Facebook like button?
I'm a beginner and new to this sort of thing. 我是初学者,还是这种事物的新手。 I already have a like button on my website, but I want to display a popup window when a user clicks that like button.
我的网站上已经有一个“喜欢”按钮,但是当用户单击“喜欢”按钮时,我想显示一个弹出窗口。 I've researched this extensively, but everything I've tried doesn't seem to work as many of the posts were outdated - such as this: Display content after clicking Facebook Like button
我对此进行了广泛的研究,但由于许多帖子已过时,因此我尝试过的所有方法似乎均不起作用-例如: 单击Facebook赞按钮后显示内容
When I try to implement the code the like button disappears entirely. 当我尝试实现代码时,like按钮将完全消失。
Can someone show me a working implementation? 有人可以给我看一个可行的实现吗? Thanks!
谢谢!
The facebook api has something generic: facebook api具有一些通用的东西:
FB.Event.subscribe(event, callback)
I need that to tie into a popup window. 我需要将其绑定到一个弹出窗口中。
If using the Graph API, it would be like: 如果使用Graph API,它将类似于:
FB.Event.subscribe('edge.create', function(url, likeButtonElement){
if(url === 'replace this String with like url String'){
// do something with DOM maybe using likeButtonElement
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.