Bug Tracker

Opened 16 years ago

Closed 15 years ago

Last modified 11 years ago

#1878 closed bug (fixed)

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

Change History (2)

comment:1 Changed 16 years ago by brandon

need: ReviewTest Case

Could you provide a test case and a diff?

comment:2 Changed 15 years ago by brandon

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.

Note: See TracTickets for help on using tickets.