Skip to main content

Bug Tracker

Side navigation

#1320 closed bug (fixed)

Opened June 25, 2007 03:48PM UTC

Closed September 27, 2007 03:23PM UTC

Last modified March 15, 2012 04:32PM UTC

In IE, $(document).ready fires too soon.

Reported by: steveh Owned by: john
Priority: major Milestone: 1.2.2
Component: event Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

I am developing a large RIA application that loads many javascript and CSS files into a very large DOM. In IE6 and IE7, jQuery is firing the ready event when the document goes to 'interactive' state rather than waiting for 'complete' state.

I believe that the problem is with the following line of code (at line 1500 in 1.1.2 uncompressed revision 1465):

if ( this.readyState != "complete" ) return;

Here, 'this' refers to the script tag which ''does'' have a state of 'complete', however the debugger shows that 'document.readyState' still has the state 'interactive.'

When I change this line to read:

if ( document.readyState != "complete" ) return;

Then the problems that I am seeing in my code go away.

Attachments (0)
Change History (6)

Changed July 12, 2007 08:15PM UTC by cjscott69 comment:1

Confirmed this bug and fix (thanks!) as well. This is also a bug in 1.1.3.

Changed July 12, 2007 08:22PM UTC by cjscott69 comment:2

Replying to [comment:1 cjscott69]:

Confirmed this bug and fix (thanks!) as well. This is also a bug in 1.1.3.

That should be 1.1.3.1

Changed July 12, 2007 08:33PM UTC by john comment:3

component: coreevent
milestone: 1.21.1.4
resolution: → fixed
status: newclosed
version: 1.1.21.1.3

Fixed in SVN rev [2332].

Changed July 27, 2007 06:55PM UTC by john comment:4

resolution: fixed
status: closedreopened

Ok, so this fixed the problem, but actually made document ready fire far too late, this needs to be resolved.

Changed July 27, 2007 06:55PM UTC by john comment:5

owner: → john
status: reopenednew

Changed September 27, 2007 03:23PM UTC by john comment:6

milestone: 1.1.41.2.2
resolution: → fixed
status: newclosed
version: 1.1.31.2.1

Fixed in SVN rev [3484].