jQuery: The Write Less, Do More JavaScript Library

Ticket #1320 (closed bug: fixed)

Opened 1 year ago

Last modified 11 months ago

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

Reported by: steveh Assigned to: john
Type: bug Priority: major
Milestone: 1.2.2 Component: event
Version: 1.2.1 Keywords:
Cc: Needs: Review

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

Change History

follow-up: ↓ 2   Changed 1 year ago by cjscott69

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

in reply to: ↑ 1   Changed 1 year 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

  Changed 1 year ago by john

  • status changed from new to closed
  • component changed from core to event
  • version changed from 1.1.2 to 1.1.3
  • resolution set to fixed
  • milestone changed from 1.2 to 1.1.4

Fixed in SVN rev [2332].

  Changed 1 year ago by john

  • status changed from closed to reopened
  • resolution deleted

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

  Changed 1 year ago by john

  • owner set to john
  • status changed from reopened to new

  Changed 11 months ago by john

  • status changed from new to closed
  • version changed from 1.1.3 to 1.2.1
  • resolution set to fixed
  • milestone changed from 1.1.4 to 1.2.2

Fixed in SVN rev [3484].

Note: See TracTickets for help on using tickets.