facebook web app

html 5 與 widget 的應用:在網站中加入按讚與留言回應

(將下方的碼加入 html 中)
<section class="recommend"><!--放讚-->
<div class="fb-like" data-send="true" data-layout="button_count" data-show-faces="false" data-font="arial"></div>
</section>
<section class="fb-thread"><!--放回應-->
<div class="fb-comments" data-width="640"></div>
</section>
<div id="fb-root"></div>
<!--動態載入 widget-->
<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/zh_TW/all.js#xfbml=1&appId=253870311369167";
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>