|
»
»
»
« Return to Thread: Implementation of DOMContentLoaded failing when no assets
Re: Implementation of DOMContentLoaded failing when no assets
Is there any reason the onreadystatechange event handler has to be
restricted to window == top? I'm really not very familiar with the
details
of that event in IE. But if it is firing before onload then it would
be a
great thing to allow in frames to improve .ready() in those cases.
David
On Mar 29, 5:06 am, Diego Perini <diego.per...@...> wrote:
> I have filed a ticket for this bug, it is #2614.
>
> This bug can introduce a possible different order of execution
> between IE and the other browsers, since "onload" on IE can
> fire before the ".ready()" method, while in other browsers this
> is assured not to be the case and "ready" will always fire
> before "onload".
>
> It seems it is not only when no assets are present in the page,
> I have tested with small images and the problem is still there.
>
> Diego Perini
>
> On 21 Mar, 13:33, Diego Perini <diego.per...@...> wrote:
>
>
>
> > Here is a small test that should output this sequence:
>
> > * readystatechange
> > * iecontentloaded
> > * load
>
> > both in the body and in the window status bar (if enabled).
>
> > The results with current jQuery and no assets is instead:
>
> > * readystatechange
> > * load
> > * iecontentloaded
>
> > thus the "onload" function fires before the ".ready()" method.
>
> > Substitute square brackets with angle brackets in this code:
>
> > [script type="text/javascript" src="jquery-1.2.3.js.orig"][/script]
> > [script type="text/javascript"]
> > /* IEContentLoaded test (jQuery implementation) */
> > $(document).ready(function () {
> > document.body.innerHTML += ' * iecontentloaded[br /]';
> > status += ' * iecontentloaded';});
>
> > /* Event "onready..." still available to applications */
> > document.onreadystatechange = function () {
> > if (this.readyState == 'complete') {
> > document.body.innerHTML += ' * ' + event.type + '[br /]';
> > status += ' * ' + event.type;
> > }};
>
> > /* Event "onload" still available to applications */
> > window.onload = function () {
> > document.body.innerHTML += ' * ' + event.type + '[br /]';
> > status += ' * ' + event.type;};
>
> > [/script]
>
> > I already know where the problem lies, I only have to setup
> > a patch for current code, hopefully including also the other
> > expected behavior of ".ready()" being called by default
> > at startup. This is for the "Lazy Loading" approach to
> > work consistently (want to use "isReady()" later on).
>
> > Diego Perini
>
> > On 20 Mar, 19:35, Diego Perini <diego.per...@...> wrote:
>
> > > This is only an IE problem.
>
> > > The "onload" event always fire before the "ready()" method in IE
> > > when there are no assets (images/objects/styles) in the page.
>
> > > I already new the implementation of IEContentLoaded in jQuery
> > > was not complete, but I was told that the "onload" fall back will
> > > always be a last resort solution so there would not have been
> > > problems, the correct firing would have taken care of anyway.
>
> > > I need to setup some more test to show the exact problem,
> > > then I will submit the needed patch for this eventuality.
>
> > > This may be somehow related to the problem posted in this group
> > > about lazy loading jQuery. If the user does not setup a "ready()"
> > > wrapped function, isReady will never become true.
> > > I should reread that post though.
>
> > > Diego Perini- Hide quoted text -
>
> - Show quoted text -
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---
« Return to Thread: Implementation of DOMContentLoaded failing when no assets
| Free Forum Powered by Nabble | Forum Help |