New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document.readyState 'interactive' #278
Comments
Is this related to #159? |
@mislav it does look related in terms of the readyState, but I'm not sure what the issue means by "dynamic script elements". From what I can see...
|
Ammending that last comment. Testcase: https://gist.github.com/1228091 |
This is actually something I believe would be fixed better if Zepto just kept an internal flag of: Rather than looking at the readyState, simply add a one-off internal listener to DOMContentLoaded, when fired, set the internal flag to true, and remove itself. When adding ready handlers from the Zepto api, if the flag is false, add the callback as a listener of DOMContentLoaded. Doing it this way decouples Zepto from the implementation of readyState, and just relies on the event. I may try to get to doing a pull request, but if someone beats me to it, just update this issue thanks! |
Hmmm... I am already foreseeing the same issue with my previous idea before I even started. If the internal listener is added first. I'm not sure if using the capture phase works on this event or not, if so the internal could use the capture, while the callbacks use the bubble. |
Browser's aren't supposed to guarantee the consistent order of event handlers fired. So, if we add an internal domready handler, it's not guaranteed that it will fire first. Not sure what to do about this issue (and the linked one) yet, but thanks for adding your thoughts here. I'll definitely do something about all this before the next release |
In Safari 5.1 and iOS 5 they have implemented the readyState 'interactive' which seems to be set after the DOMContentLoaded event has fired.
I was wondering if something like this would work, or would it break in previous versions?
The text was updated successfully, but these errors were encountered: