简体   繁体   English

用户单击Facebook赞按钮后,如何显示带有消息的弹出窗口?

[英]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.

相关问题 当用户单击按钮时,如何使用textarea弹出窗口? - How can I have a textarea popup when the user clicks a button? 有人单击类似Facebook的按钮后,如何关闭引导程序模式? - How can I close a bootstrap modal after someone clicks a facebook like button? 如果用户单击浏览器按钮,如何显示消息? - How to display message if user clicks on browser button? 检测用户何时“点击”Facebook 点赞按钮 - Detect when user “clicks” the Facebook like button 单击提交后如何隐藏内容(如文本,单选按钮和提交按钮)弹出窗口并在同一弹出窗口中显示新内容? - How to hide content(like text, radio button, and submit button) Popup window after Clicking on submit and display new content in the same popup? 用户单击音频标签中的播放按钮时如何显示消息? - How to display a message when user clicks the play button in audio tag? 用户单击文件上传中的关闭按钮后,如何关闭窗口? - How do I close a window after the user clicks on the close button in file upload? 如何使用 javascript 获取每个用户在 Facebook 共享按钮上的点击次数 - How can I get number of clicks on a facebook share button per user using javascript 用户点击按钮后,有没有办法更换 window? - Is there a way to replace the window after user clicks button? 当用户单击按钮时,如何创建空格线(如 br)? - How can I create a space line (like a br) when user clicks on button?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM