Skip to main content

Bug Tracker

Side navigation

#1878 closed bug (fixed)

Opened November 01, 2007 02:40PM UTC

Closed December 08, 2007 05:16AM UTC

Last modified March 15, 2012 06:41PM UTC

Document Ready Problem

Reported by: snit-ram Owned by:
Priority: major Milestone: 1.2.2
Component: core Version: 1.2.1
Keywords: Cc:
Blocked by: Blocking:
Description

Hi, people. I've got some "operation aborted" erros when using

jQuery's $( document ).ready(); function for wainting page to load and

after this, manipulating some HTML elements.

This problem occours both in IE 6 and 7. I've corrected it,

overwriting some functions right after importing jQuery. This is the

code I've used to fix this problem:

jQuery.ready = function(){

if ( !jQuery.isReady ){

jQuery.isReady = true;

if( jQuery.browser.msie ){

if( document.readyState != 4 && document.readyState != 'complete' )

{

jQuery.isReady = false;

document.onreadystatechange = function(){

if( document.readyState == 4 || document.readyState ==

'complete' ){

jQuery.ready();

};

};

return false;

};

};

if( jQuery.readyList ) {

jQuery.each(jQuery.readyList, function () {

this.apply( document );

});

jQuery.readyList = null;

};

if( jQuery.browser.mozilla || jQuery.browser.opera ){

document.removeEventListener( "DOMContentLoaded", jQuery.ready,

false );

};

if( !window.frames.length ){

jQuery( window ).load( function(){

jQuery("#__ie_init").remove();

});

};

};

};

jQuery.prototype.ready = function( f ){

if( jQuery.isReady ){

if( jQuery.browser.msie ){

if( document.readyState == 4 || document.readyState == 'complete' )

{

f.apply( document, [ jQuery ] );

}else{

document.onreadystatechange = function(){

if( document.readyState == 4 || document.readyState ==

'complete' ){

f.apply( document, [ jQuery ] );

};

};

};

}else{

f.apply( document, [ jQuery ] );

};

} else {

jQuery.readyList.push( function () {

return f.apply( this, [ jQuery ] );

} );

};

return this;

};

How you can see, It's just a little bit different of jQuery original

code.

Bye,

Rafael Martins

Attachments (0)
Change History (2)

Changed November 14, 2007 05:10AM UTC by brandon comment:1

need: ReviewTest Case

Could you provide a test case and a diff?

Changed December 08, 2007 05:16AM UTC by brandon comment:2

resolution: → fixed
status: newclosed

I believe this should be fixed with the latest SVN. Please feel free to reopen with a test case if it is still not working for you.