Created
October 31, 2016 07:29
-
-
Save pixiebox/1e9e0e38dd2ee7ee5a4adbb67a0c8d5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- at the bottom of the body element --> | |
<div id="fb-root"></div> | |
<script type="text/javascript"> | |
(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/en_GB/all.js#xfbml=1&appId=************"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk')); | |
</script> | |
<!-- hardcoded --> | |
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="recommend" data-show-faces="false" data-share="true"></div> | |
<!-- dynamicly --> | |
<script type="text/javascript"> | |
var container = document.getElementById('containerX'); | |
container.appendChild('<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="button_count" data-action="recommend" data-show-faces="false" data-share="true"></div>'); | |
FB.XFBML.parse(container); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment