<script> window.kakaoAsyncInit = function () { Kakao.PlusFriend.createAddFriendButton({ container: '#plusfriend-add-button' }); }; (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 = "//developers.kakao.com/sdk/js/kakao.plusfriend.min.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'kakao-js-sdk')); </script>
<div id="plusfriend-add-button" data-plusfriend-id="#encoded-id#" data-size="#size#" data-color="#color#" data-shape="#shape#"></div>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"/> <meta http-equiv="X-UA-Compatible" content="IE=edge"/> <meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width"/> <title>PlusFriend Create Add Button Demo - Kakao JavaScript SDK</title> <script src="//developers.kakao.com/sdk/js/kakao.min.js"></script> </head> <body> <div id="plusfriend-add-button"></div> <script type='text/javascript'> //<![CDATA[ // 사용할 앱의 JavaScript 키를 설정해 주세요. Kakao.init('YOUR APP KEY'); // 스토리 공유 버튼을 생성합니다. Kakao.PlusFriend.createAddFriendButton({ container: '#plusfriend-add-button', plusFriendId: '${demoPfId}' }); //]]> </script> </body> </html>