IT

<!-- html5 facebook sdk 설정-->

<html xml:lang="ko" lang="ko">
<head>
    <meta charset="EUC-KR">
    <title>HTML5 Version</title>
</head>
<body>
    <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 = "//connect.facebook.net/ko_KR/all.js#xfbml=1";
   fjs.parentNode.insertBefore(js, fjs);
  }(document, 'script', 'facebook-jssdk'));
 </script>
    
 <div class="fb-share-button" data-href="http://developers.facebook.com/docs/plugins/" data-type="button"></div>
</body>      
</html>

<!-- XFBML facebook sdk 설정-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://ogp.me/ns/fb#" xml:lang="ko" lang="ko">
    <meta http-equiv="Content-type" content="text/html;charset=euc-kr" />   
    <title>XFBML Version</title>
</head>
<body>
    <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 = "//connect.facebook.net/ko_KR/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));   
 </script>
   
    <fb:share-button href="http://www.naver.com" type="button"></fb:share-button>   
<body>   
</html>

// twitter lib 로드
  !function(d, s, id) {
   var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/
     .test(d.location) ? 'http' : 'https';
   if (!d.getElementById(id)) {
    js = d.createElement(s);
    js.id = id;
    js.src = p + '://platform.twitter.com/widgets.js';
    fjs.parentNode.insertBefore(js, fjs);
   }
  }(document, 'script', 'twitter-wjs');

facebook share, like, comment 등 버튼은 페이스북 개발자 페이지에서 코드를 생성할 수 있다.

twitter tweet 버튼은 트위터 개발자 페이에서 코드를 생성할 수 있다.

Posted by sinpk