Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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
You can’t perform that action at this time.