Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

Old topic but a new problem - see also the new comment from @gkpo

Sorry, I can't comment (low reputation) but I tried several things to resolve the Facebook 'Like Plugin' issue.

The Facebook like.php returns a DENY for X-Frame-Options.

So I tried to renew the script Facebook plugin like. -> Does not work.

I tried setting up X-frame options for my page (allow Facebook). -> Does not work.

Then I tried to link my page with Facebook business manager (there is an option to link pages with verification). I thought this is the solution because the like button was back, but the secret was my Facebook login.

The plugin does not return DENY if you are logged into Facebook.

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top