Partial Outageshare-external
Facebook like button not working
1

I have an old iframe like button on my product page which is no more working. I just updated my implementation to use the facebook SDK but still getting the same error: The loading of “https://www.facebook.com/plugins/like/connect” in a frame is denied by “X-Frame-Options“ directive set to “deny“.

I have the initialization code and everything setup correctly but not sure why it isn't working. Any help will be highly appreciated. Thanks in advance!

Nadeem
Asked about 6 months ago
Selected Answer
1

Here is the code using JS SDK that might help you.

June 28 at 1:54 PM
Nadeem
Nadeem

Make sure you are logged in to facebook on same window to make it work.

June 29 at 3:02 AM
Daniel

Thanks man, but nope! That's the same code I'm using, and after I click the like button this happens:

https://drive.google.com/file/d/1k-y7IzEr4s9NNmrIFYr5tmsRpFFvG0r4/view?usp=sharing

The whole thing disappears. I also tried removing twitter and pinterest buttons, just in case, but the same error still happens. Many people asked me what I use those buttons for, since almost no one uses them anymore, but I'm old-fashioned haha.

June 29 at 9:49 PM
Nadeem

@Daniel Are you testing with facebook logged in in same browser? Also, are you using the live domain? It will not work with localhost. It is working for me partially. That is, it is working for some of the product pages but not working for others. I am not sure why it is behaving like this.

And yes, I think no one use this but we have this on every product page. So we need to fix this.

July 1 at 1:33 AM
Nadeem

May be it takes time to register the like event?

July 1 at 1:37 AM
Nadeem

I have also added og meta tags e.g.

July 1 at 1:39 AM
2

Could you fix this problem? It's happening to me too. Also, when I click "like", both the like and share buttons break and dissapear. Editing my .htaccess file and changing X-Frame-Options to "sameorigin" didn't help at all either.

June 20 at 6:17 AM
Daniel
Nadeem

They just don't reply to any post. Nice to hear from meta team!

June 20 at 7:32 AM
Daniel

I was reading in different threads and apparently this problem has been happening for more than 8 months, and they still haven't solved it. Unbelievable.

June 21 at 6:51 AM
Nadeem

Yes, that is correct. I also found many related threads but no one even replied from the facebook development team which is really frustrating.

June 21 at 8:02 AM
Daniel

I know, man. You know, there's an official community on Facebook: https://www.facebook.com/groups/146797922030397

I published a question there, but the administrators deleted it without giving any explanation. It seems totally disrespectful to me, but hey, maybe you'll have better luck.

June 21 at 8:57 PM