How can I trigger Facebook's Like action without using facebook like button?

别等时光非礼了梦想. 提交于 2020-01-06 04:34:09

问题


I am trying to trigger the "Like" action to a url by the visitor (if they're logged into facebook) from the user clicking on a button that's on my site. I don't want to embed the facebook like button otherwise the user would have to take two separate actions (e.g. click on my button AND click on the facebook like button). Is there a way to do this?


回答1:


There is no way to do this that won't get you penalized by Facebook if they find out.

This is intentional to prevent clickjacking and like-worms.

The only alternative would be creating a Facebook App, have the user give you the right to write to his wall and like and then use the Facebook API to directly like your page. However this would be many more steps than the above.

The Facebook like button features quite a few variations. The easiest way would be to pick the one among them that fits your design best and replace your button with it.



来源:https://stackoverflow.com/questions/6365205/how-can-i-trigger-facebooks-like-action-without-using-facebook-like-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!