Skip to content

Instantly share code, notes, and snippets.

@rakeshpai
Created January 11, 2012 14:33
Show Gist options
  • Save rakeshpai/1594924 to your computer and use it in GitHub Desktop.
Save rakeshpai/1594924 to your computer and use it in GitHub Desktop.
Errorception's async loader
<script>
// <snip>
(function (window, document) {
var loader = function () {
var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0];
script.src = "http://errorception.com/projects/" + _errs[0] + "/beacon.js";
tag.parentNode.insertBefore(script, tag);
};
// Wait until window.onload before downloading any more code.
window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader);
})(window, document);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment