Created
March 27, 2013 15:24
-
-
Save bjankord/5255061 to your computer and use it in GitHub Desktop.
WIP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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