Facebook 'like button' return X-Frame-Options Deny

谁都会走 提交于 2019-12-23 17:06:17

问题


I'm trying to put a facebook 'like button' on each post of a blog. The code was pasted correctly, but i'm getting this error:

Refused to display 'https://www.facebook.com/undefined/plugins/like.php?action=recommend&app_id…%2F&layout=button_count&locale=pt_BR&sdk=joey&share=false&show_faces=false' in a frame because it set 'X-Frame-Options' to 'DENY'.

There is a 'undefined' after facebook.com/, and i don't know why.

Any idea how to solve this issue?


回答1:


This is unfortunately a bug in how the JS SDK does implicit initialization (the init params in the url), so you're doing everything correct.

A fix is being prepared, but for now, you can use /en_US/all.js instead of /en_US/sdk.js.




回答2:


If you're in control of the server this is running on, check what security middleware you might be using. For example, I'm running a node server and I had to disable xssFilter middleware and frameguard middleware and now it runs.



来源:https://stackoverflow.com/questions/23417208/facebook-like-button-return-x-frame-options-deny

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