document.ready in jQuery 1.1.4 - IE and FF inconsistent behavior
(Note: JR requested I post this here instead of the general support
forum)
Hi,
A number of folks have independently come across this issue. What I
would like to hear from John Resig or from other team members if the
change was intentional? and why?
In short, what I found is that $(document).ready() behaves differently
in 1.1.4 for FF and IE.
It appears to me that the 1.1.4 ready() method is bound to the true
windows onload event in IE. In other words, $(document).ready() will
not fire until body onload event is fired.
This is not the behavior in 1.1.3 under IE and/or FF.
Now, I was curious and studied this.
1) Again, I don't know if this was a intentional, but it looks like
there was a "cleanup" or modulization of code in 1.1.4 and this might
have unintentionally altered the behavior. A bindReady() function was
used to wrap some existing code. Not sure if behavior change was
expected.
2) You can clearly see the difference when there are images in the
page. Technically, the page is recieved but it is not rendered which
is when the window onload event is signed. Document.Ready is being
started when the page is received.
So maybe the issue is more about outstanding socket requests like
images that are still pending before the page is fully rendered.
The question is then, what does jQuery's document.ready() really
mean? Does it means the entire page is fullly rendered (or images are
loaded hence when window.onload is signal) or does it mean the last
element in the page has been processed?
Why is this important?
Well, 1st the browser behavior is different. That needs to be fixed.
2nd, there are other ideas that now come into play and will be altered
in 1.1.3 and 1.1.3, such as embedded html and script tag evaluations
ideas that can drive somone nuts until the 1st item is resolved.
John? Anyone?
Am I missing something here?
--
HLS