웹 페이지에 페이스 북의 "좋아요"버튼을 표시하려고합니다. 그렇게하기 위해 공식 가이드 here을 따르기로 결정했습니다.웹 페이지에 버튼처럼 페이스 북을 추가합니다.
먼저 내가 로컬 HTML 파일에 제안 된 코드를 덤프하고 브라우저 사용하여보고하기로 결정
<html>
<head>
<title>Your Website Title</title>
<!-- You can use open graph tags to customize link previews.
Learn more: https://developers.facebook.com/docs/sharing/webmasters -->
<meta property="og:url" content="http://www.your-domain.com/your-page.html" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Your Website Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="http://www.your-domain.com/path/image.jpg" />
</head>
<body>
<!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<!-- Your like button code -->
<div class="fb-like"
data-href="https://developers.facebook.com/docs/plugins/"
data-layout="standard"
data-action="like"
data-show-faces="true">
</div>
</body>
</html>
가 작동하지 않았다 후를, 나는 SO에 대한보고 및 this answer를 발견하고 실현 그 HTML은 웹 서버에 의해 제공되어야하며 은 https://connect.facebook.net/en_US/all.js
으로 업데이트해야합니다. 그러나 그 후에는 Mac에서 Chrome을 사용하여 페이지를 볼 때 완전히 빈 페이지 만 볼 수 있습니다.
페이지 소스를 검사 할 때 내 소스 코드를 볼 수는 있지만 시각적 정보는 전혀 볼 수 없습니다.
무엇을 제공합니까?
공개적으로 액세스 할 수있는 IP 또는 도메인 이름을 통해 액세스 할 수있는 웹 페이지가 없어 지금 당장 도움이되지 않습니다. – ForeverStudent
그 원인이 될 수 있습니다. – AndrewLeonardi
이유를 설명해 주시겠습니까? 공용 서버에서 호스트되지 않는 한 작동하지 않는 것은 의미가 없습니다. – ForeverStudent