ded / domready

lets you know when the dom is ready
MIT License
874 stars 129 forks source link

readyState regex is wrong #14

Closed devdazed closed 10 years ago

devdazed commented 12 years ago

The following regex passes when the document state contains a c but does not start with one, one example is IE's interactive state.

loaded = /^loade|c/.test(doc[readyState])

it should probably be changed to:

loaded = /^loade|^c/.test(doc[readyState])
ded commented 12 years ago

you're right. i'll have a patch shortly

r4j4h commented 12 years ago

Hi there, I made a pull request for this for you https://github.com/ded/domready/pull/15

r4j4h commented 11 years ago

A guy named webspinner made a good observation:

This will miss the case where "interactive" is the appropriate value in most browsers. You only need to check for "complete" in IE9 and IE10;

patik commented 10 years ago

It appears to be fixed via #15, so perhaps this issue could be closed.

devdazed commented 10 years ago

Good point

ded commented 10 years ago

i thought i closed this issue myself. sorry about not notifying y'all