2016-08-22 5 views
0

웹 페이지에 페이스 북의 "좋아요"버튼을 표시하려고합니다. 그렇게하기 위해 공식 가이드 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을 사용하여 페이지를 볼 때 완전히 빈 페이지 만 볼 수 있습니다.

페이지 소스를 검사 할 때 내 소스 코드를 볼 수는 있지만 시각적 정보는 전혀 볼 수 없습니다.

무엇을 제공합니까?

답변

1

나는 최근이 같은 과정을 거쳤고 왜 그것이 작동하지 않는지 알 수 없었다. 그것이 작동하고 있었다고 밝혀지면 FaceBook은 아직 업데이트되지 않았다. 현재 업데이트하도록 강요 할 수

https://developers.facebook.com/tools/debug/

당신의 URL를 입력하고 버튼을 누릅니다 : 다시 쳤어요. 도움이되는지 확인하십시오.

+0

공개적으로 액세스 할 수있는 IP 또는 도메인 이름을 통해 액세스 할 수있는 웹 페이지가 없어 지금 당장 도움이되지 않습니다. – ForeverStudent

+0

그 원인이 될 수 있습니다. – AndrewLeonardi

+0

이유를 설명해 주시겠습니까? 공용 서버에서 호스트되지 않는 한 작동하지 않는 것은 의미가 없습니다. – ForeverStudent

관련 문제