부분 중단share-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
질문함 약 6개월 전
선택한 답변
1

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

6월 28일 오후 1:54
Nadeem
Nadeem

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

6월 29일 오전 3: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.

6월 29일 오후 9: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.

7월 1일 오전 1:33
Nadeem

May be it takes time to register the like event?

7월 1일 오전 1:37
Nadeem

I have also added og meta tags e.g.

7월 1일 오전 1: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.

6월 20일 오전 6:17
Daniel
Nadeem

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

6월 20일 오전 7: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.

6월 21일 오전 6: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.

6월 21일 오전 8: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.

6월 21일 오후 8:57