Skip to content

Instantly share code, notes, and snippets.

@bjankord
Created March 27, 2013 15:24
Show Gist options
  • Save bjankord/5255061 to your computer and use it in GitHub Desktop.
Save bjankord/5255061 to your computer and use it in GitHub Desktop.
WIP
ready: (function() {
...
//Mozilla, Opera, and Webkit
if (document.addEventListener) {
document.addEventListener("DOMContentLoaded", idempotent_fn, false);
...
}
//IE event model
else if (document.attachEvent) {
// ensure firing before onload; maybe late but safe also for iframes
document.attachEvent("onreadystatechange", idempotent_fn);
// A fallback to window.onload, that will always work
window.attachEvent("onload", idempotent_fn);
...
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment