You keep saying "rendered".  Let's be clear about this.

The ready statement fires after the DOM has been been created in-memory can
can be accessed through selectors.

The browser doesn't "pause" the rendering of the page once the DOM has been
loaded to handle events.

For example, you'll notice on an HTML page where the images have no width
and height defined, that the page will started rendering immediately, and
then as the images are downloaded, the page layout keeps being adjusted to
fit the now available images.

The document ready function fires after the HTML has been loaded, but before
all of the images and other binary content have downloaded.
 
As a matter of fact, a page can even start rendering BEFORE the HTML is
fully downloaded.  You can test this on an ASP server by writing to the
response stream, then "flushing" the stream, then writing more to the
stream, then "flushing" the stream again.  The page will render each bit as
it comes in, even though the HTML isn't fully downloaded.

Does this answer your question?

JK


-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Daniel Keel
Sent: Tuesday, December 18, 2007 12:03 PM
To: jQuery (English)
Subject: [jQuery] Re: $(document).ready same es Dean Edwards solution


I do all the JavaScript within $(document).ready and not in the
window.onload.
As far as I understand, the $(document).ready event is fired before
the HTML is rendered (DOMContentLoaded in FF). Is this correct or am I
mistaken?


-daniEL

On Dec 18, 8:47 pm, "Jeffrey Kretz" <[EMAIL PROTECTED]> wrote:
> Someone else with more experience should confirm this, but I believe the
> ready function fires after the HTML is loaded but before the images or
other
> binary content is downloaded.  I don't believe it has anything to do with
> the browser rendering the page or not.
>
> If you used the window.onload event, EVERYTHING needs to be downloaded
> before it fires.  The document ready fires as soon as the DOM is built.
>
> This may not be what you are looking for, but you could perhaps do the
> following:
>
>         1. Wrap your main page content in a DIV set for "display:none".
>         2. Add a floating loading element in the middle of the page.
>         3. Modify the DOM.
>         4. Then remove the loading element and display the main div.
>
> JK
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Daniel Keel
> Sent: Tuesday, December 18, 2007 9:05 AM
> To: jQuery (English)
> Subject: [jQuery] Re: $(document).ready same es Dean Edwards solution
>
> To be more precise:
>
> In Opera(9.3)  and IE6 / 7 this is what's happens
>
> - The page is loaded with the css rendering
> - The elements in question are rendered with the jQuery plugins (here
> is the problem, because the user sees this rendering life )
> - window.onload gets executed
>
> As far as I understand, the $(document).ready event means that the DOM
> is ready but that the page is not rendered yet so that you can handle
> your javascript before the user get the page rendered. Am I wrong?
>
> -daniEL
>
> On Dec 18, 3:28 am, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
> > It'd be helpful if you could post a URL with an example page where the
> > problem happens. There's a number of things that can come into play,
> > though it's usually something to do with a large amount of elements
> > being modified via JavaScript.
>
> > Karl Rudd
>
> > On Dec 18, 2007 4:54 AM, Daniel Keel <[EMAIL PROTECTED]> wrote:
>
> > > Hello, this is my first post.
>
> > > I'm working with jQuery since a month and I have one problem. The $
> > > (document).ready event doesn't work properly, manly I get the fouc in
> > > IE and Opera. As far as I have red the Dean Edwards solution (http://
> > > dean.edwards.name/weblog/2006/06/again/) is implemented in jQuery ($
> > > (document).ready ).  For now I'm fixing this issue loading a css
> > > dinamically that contains a class to hide the elements that trigger
> > > fouc.
>
> > > My main question is, does the $(document).ready include the Dean
> > > Edwards solution?
> > > Second question: Someone else experienced the fouc issue as I do? If
> > > yes, which approach was taken?
>
> > > Thanks in advance for your help and time.
>
> > > daniEL

Reply via email to