简体   繁体   English

JavaScript的Facebook的像按钮不起作用

[英]javascript facebook like button is not working

on my website I have a facebook like button (to like my facebook page). 在我的网站上,我有一个“喜欢Facebook”按钮(喜欢我的Facebook页面)。 It has been working fine until today. 到目前为止,它一直运行良好。 when someone clicks the like button it like the page, then immediately switch to the previous mode of not liking the page. 当某人单击“喜欢”按钮时,它就像页面一样,然后立即切换到不喜欢该页面的先前模式。 On my main page I am getting this error 在我的主页上,我收到此错误

There was an error liking the page. If you are the page owner, please try running your page through the linter on the Facebook devsite (https://developers.facebook.com/tools/lint/) and fixing any errors.

I tried to scan my page, but I have no errors nor warnings. 我试图扫描我的页面,但没有错误也没有警告。 I also tried making a new like button here https://developers.facebook.com/docs/reference/plugins/like/ but with every page I tried (even pages that are not mine) such as ( http://www.facebook.com/americanexpress ) I am still getting the same problem (you can see the problem on facebook without having to paste the code to your page). 我还尝试在此处https://developers.facebook.com/docs/reference/plugins/like/创建一个新的“赞”按钮,但尝试的每个页面(甚至不是我的页面)都如( http://www.facebook.com/americanexpress )我仍然遇到相同的问题(您可以在Facebook上看到此问题,而不必将代码粘贴到您的页面上)。 did facebook change any code or something ? Facebook是否更改了任何代码或其他内容? do I need to change any code such as my java script ? 我是否需要更改任何代码(例如Java脚本)?

Try This One: 试试这个:

<div class="fb-like" data-href="https://www.facebook.com/ILoveItWhenGirlsLookAtTheirOwnBoobs" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>

It is working correctly on my blog. 它在我的博客上正常工作。 You can check my blog here: 您可以在这里查看我的博客:

http://mostvisitedbloginasia.blogspot.com/

For your page, just change the username of your page. 对于您的页面,只需更改页面的用户名。 It looks like: 看起来像:

<div class="fb-like" data-href="https://www.facebook.com/YOUR-USER-NAME" data-send="true" data-layout="button_count" data-width="450" data-show-faces="true"></div>

It will work correctly! 它将正常工作!

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

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