문제 설명
자동 생성된 페이스북 댓글 상자 (Auto‑generated facebook comments boxes)
내 뉴스 페이지에 Facebook 댓글 상자를 구현하고 있습니다. 그리고 그것은 작동합니다. 문제는 한 페이지에 댓글을 작성하면 fb 댓글 상자가 포함된 모든 페이지에 표시된다는 것입니다.
현재 내 코드는 다음과 같습니다.
<b><div class="fb‑comments" data‑href="http://selandia‑ceu.dk/selandia/nyheder.aspx" data‑num‑posts="3" data‑width="500"></div>
<script>
var fb‑comments = document.getElementById('fb‑comments');
mydiv.innerHTML =
'<div class="fb‑comments" data‑href="' + document.location.href + '" data‑num‑posts="3" data‑width="500"></fb:comments>';
FB.XFBML.parse(fb‑comments);
</script></b>
웹사이트는 Microsoft Server를 사용하고 있습니다. 코드의 URL은 현재 보고 있는 페이지를 참조해야 합니다. 내가 무엇을 해야 하는지 아는 사람? :)
댓글은 페이지에서 일시적으로 비활성화됩니다.
다음 스레드에서 추가 코드(FB.XFBML.parse)를 얻었습니다. 각 ajax 호출 후 다른 Facebook 댓글 상자
참조 솔루션
방법 1:
You may need to clean up your Open Graph tags, as the URL that each comments plugin is pointed to will be scraped by the Open Graph linter and used to determine the canonical URL. The problem is likely that your comments plugins all end up pointing to the same canonical URL:
Use this Debug tool to inspect your Open Graph tags and ensure each page has it's own canonical URL. You also need to correct the fb:admins tag that you have in your HTML as suggested by the debugger.
(by user1417261、Matthew Johnston)