Panne partielleshare-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
Posée il y a environ 6 mois
Réponse sélectionnée
1

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

28 juin, 13:54
Nadeem
Nadeem

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

29 juin, 03:02
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.

29 juin, 21:49
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.

1 juillet, 01:33
Nadeem

May be it takes time to register the like event?

1 juillet, 01:37
Nadeem

I have also added og meta tags e.g.

1 juillet, 01:39
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.

20 juin, 06:17
Daniel
Nadeem

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

20 juin, 07:32
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.

21 juin, 06:51
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.

21 juin, 08:02
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.

21 juin, 20:57