简体   繁体   English

Facebook用JavaScript像按钮检测

[英]Facebook like button detect with javascript

I'm writing an app. 我在写一个应用程序。 for Facebook using HTML and Javascript. Facebook使用HTML和Javascript。 I'm trying to detect with javascript when the "Like" button on the Facebook page is clicked. 单击Facebook页面上的“赞”按钮时,我尝试使用JavaScript进行检测。 I don't want to embed a "Like" button on my app page as Facebook already has a "Like" button at the top of the page right after my company's name. 我不想在我的应用程序页面上嵌入“赞”按钮,因为Facebook在我公司名称后的页面顶部已经有一个“赞”按钮。
I'm using Facebook's iFrame to display my app, but I haven't found any examples in Javascript to catch the "Like" click event. 我正在使用Facebook的iFrame来显示我的应用程序,但是我没有在Javascript中找到任何示例来捕捉“赞”点击事件。

Thanks for any help 谢谢你的帮助

Because it is in an Iframe the same origin policy applies. 因为它在iframe中,所以应用了相同的原始政策 You cannot access content cross-domain. 您无法跨域访问内容。 It is a security violation. 这是违反安全性的行为。

On Facebook Pages, this is done through the Static FBML app. 在Facebook Pages上,这是通过Static FBML应用程序完成的。 However, Facebook phased it out on 18 March 2011, but pages using the app before that date (including BobbiBrown) will continue using it. 但是,Facebook在2011年3月18日淘汰了它,但在此日期之前使用该应用程序的页面(包括BobbiBrown)将继续使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM