Skip to content

Instantly share code, notes, and snippets.

@trafficinc
Last active December 23, 2017 14:15
Show Gist options
  • Save trafficinc/72fae98f94a3c8ac4e220b37a628b744 to your computer and use it in GitHub Desktop.
Save trafficinc/72fae98f94a3c8ac4e220b37a628b744 to your computer and use it in GitHub Desktop.
<script>
(function () {
function ready(fn) {
if (document.attachEvent ? document.readyState === "complete" : document.readyState !== "loading"){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
function init() {
console.log("We are ready now!");
}
ready(init);
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment