Skip to content

Instantly share code, notes, and snippets.

@andyvanee
Created March 29, 2014 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andyvanee/9849384 to your computer and use it in GitHub Desktop.
Save andyvanee/9849384 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>async</title>
</head>
<body>
<div id="async-scripts">Social widgets will go here...</div>
<div>Page contents here...</div>
<script id="script-sandbox" type="text/html-template">
<div class="my-toolbar">
<a href="https://twitter.com/andyvanee" class="twitter-follow-button" data-show-count="false" data-width="60px" data-align="left">Follow @andyvanee</a>
<a href="https://twitter.com/share" class="twitter-share-button" data-via="andyvanee">Tweet</a>
--#script#-- !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');--#/script#--
... the rest of your widgets here ...
</div>
</script>
<script>
jQuery(function($){
var sandbox = $("#script-sandbox").html().replace(/--#/g, '<').replace(/#--/g, '>');
$("#async-scripts").append($(share_html));
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment