Skip to content

Instantly share code, notes, and snippets.

@ki6ool
Last active March 4, 2016 09:16
Show Gist options
  • Save ki6ool/f8e8aac3dd1d183862fa to your computer and use it in GitHub Desktop.
Save ki6ool/f8e8aac3dd1d183862fa to your computer and use it in GitHub Desktop.
各SNSのJSをまとめて読み込むやつ
<script>
/**
* @link http://tokkono.cute.coocan.jp/blog/slow/index.php/xhtmlcss/asynchronous-loading-of-major-social-buttons/
*/
(function(w,d){
w.___gcfg={lang:"ja"};
var s,e = d.getElementsByTagName("script")[0],
a=function(u,f){if(!d.getElementById(f)){s=d.createElement("script");
s.src=u;if(f){s.id=f;}e.parentNode.insertBefore(s,e);}};
a("//b.st-hatena.com/js/bookmark_button.js");//hatena
a("//platform.twitter.com/widgets.js","twitter-wjs");//twitter
a("//connect.facebook.net/ja_JP/all.js#xfbml=1&version=v2.0","facebook-jssdk");//facebook
a("https://widgets.getpocket.com/v1/j/btn.js?v=1");//pocket
a("https://apis.google.com/js/plusone.js");//google
})(this, document);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment