Skip to content

Instantly share code, notes, and snippets.

@tobie
Created February 24, 2011 11:53
Show Gist options
  • Save tobie/842085 to your computer and use it in GitHub Desktop.
Save tobie/842085 to your computer and use it in GitHub Desktop.
Moar smallest DOMReady code, EVAR!
function r(f){setTimeout(/in/(document.readyState)?r:f,9,f)}
@jed
Copy link

jed commented Feb 25, 2011

the third argument in IE is language? that is insanity.

the short war isn't fruitless though, since it's pretty instructive.

i'm curious, though; why do you use domContentLoaded to fix readyState in FF 3.6 instead of just using it as the domready function?

@ded
Copy link

ded commented Feb 25, 2011

i use it to fix FF <=3.5, because they had no proper readyState.

@jed
Copy link

jed commented Feb 25, 2011

right, but why fix it at all if all you need to know is when the document content is loaded? after all, the polling is only a fallback for a real domContentLoaded, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment