-
Notifications
You must be signed in to change notification settings - Fork 336
$script.domReady doesn't work correctly in IE, Chrome, Opera, & Firefox. #8
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
Comments
Thanks for reporting, we started playing around with some different solutions today. |
also 1.2 doesn't actually attach private domReady to the $script, like it did in 1.1. |
Not sure if it is related to this ticket, in my case when i try to use $script.domReady() i get an JS error: $script.domReady is not a function This is with the latest version pulled today from github. |
@lmartins - downgrade to 1.1 - you'll have domReady working, or don't depend on |
fixed. 167a541 |
just recalling this - it might fail if a document "incomplete" occurs |
There is no There is still a problem with the dom-load detection. Here is a test to confirm a JS error in IE6/7/8 when attempting to use |
cool. I couldn't find references to incomplete (it's only for XHR apparently). I'll bootup IE and have a play. I'm a bit less worried about iframes (and the doScroll hacks). getting this base will cover what we need. |
The |
cool. not much trickiness, but it now passes in IE7+ (quirks & standards) — i'm afraid i don't have access to IE6 atm. I imagine it passes. thanks again. |
Opera may also contain "msi" in its UA string. There is no need for sniffing, at least replace it with a simple inference You should avoid An |
In iframes |
patched. |
Sorry, I know you want the bug squashed, but it's still not working in IE iframes (window onload is firing before dom-load): http://jsbin.com/abise4 |
i tested this already. it works for me in IE7 quirks. maybe i'm missing something |
that's weird. that jsbin example doesn't even put in window onload. |
^ turns out IE (on Windows7) blocks bad mimetypes from linking to the raw github sources. |
You're missing a ton of history behind the current dom-load solutions. The As mentioned earlier you'll also need to use a document Things to note:
|
i did the onreadystatechange while you were responding. everything appears to be working now. |
i'm not accessing any properties on top. it's only a comparison check. it's also not hanging for me. http://jsbin.com/akige5/5 |
the detached element is a good idea. just added it in. since everything is working. i'm closing this out now. thanks for the research. |
for your own sanity as well, it's not causing the x-domain issues you brought up. self != top is just making sure you're in a framed document. however if one attempts to access a property (like top.foo) - then you'll get the security errors. |
Yap, the |
hmmm.... that's no good. can you reproduce? perhaps it was an intermittent upload i was doing... |
Ya could be, I will dig around a bit. On a side note, you should use |
since listening to 'onload' is sometimes causing it to fire after the other onload, i used attachEvent('onreadystatechange', then of course, detach the event when the document is complete. this at the least ensures it fires before someone else's window.onload, and won't collide with someone elses document.onreadystatechange. |
Here is the requested test for the IE6 |
Phew, now that this issue is practically resolved it would rock if the blog post, "Smallest DOMReady code, ever.", would be tweaked so that others don't have to go through all this. |
i can make a note of it. |
Thanks for adding the note to your blog. I forgot to mention that the |
Your $script.domReady() solution fails to work correctly in versions of IE, Chrome, Opera, & Firefox (http://jsbin.com/uxure5) and instead produces results similar to
window.onload
.The text was updated successfully, but these errors were encountered: