Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 8 years ago

#1320 closed bug (fixed)

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.

Change History (6)

comment:1 Changed 13 years ago by cjscott69

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

comment:2 in reply to:  1 Changed 13 years ago by cjscott69

Replying to 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

comment:3 Changed 13 years ago by john

Component: coreevent
Milestone: 1.21.1.4
Resolution: fixed
Status: newclosed
Version: 1.1.21.1.3

Fixed in SVN rev [2332].

comment:4 Changed 13 years ago by john

Resolution: fixed
Status: closedreopened

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

comment:5 Changed 13 years ago by john

Owner: set to john
Status: reopenednew

comment:6 Changed 13 years ago by john

Milestone: 1.1.41.2.2
Resolution: fixed
Status: newclosed
Version: 1.1.31.2.1

Fixed in SVN rev [3484].

Note: See TracTickets for help on using tickets.