Skip to main content

Bug Tracker

Side navigation

#4333 closed bug (invalid)

Opened March 11, 2009 08:05PM UTC

Closed August 09, 2009 01:37AM UTC

Jquery Selector and window onload

Reported by: onthefloor Owned by:
Priority: major Milestone: 1.3.2
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

Hi there:

So i updated to 1.3.2 version today, and i found a bug :

So when i add function at parameter, this parameter is an function pointer, so when the page was loading i call this function :

example:

function addLoadEvent(function_) {

var old= window.onload;

document.getElementById("preLoadDiv").style.display = "block";

if (typeof window.onload != 'function') {

window.onload = function_;

} else {

window.onload = function() {

if (old) {

old();

}

function_();

}

}

}

And when i was calling :

addLoadEvent(function() {

$("#preLoadDiv").hide("slow");

});

It was work perfectly in 1.3.1 version, please fix it, thank you.

My pages use that function.

Attachments (3)
  • jquery-1.3.1.js (54.0 KB) - added by onthefloor March 12, 2009 01:55AM UTC.
  • jquery-1.3.2.js (55.9 KB) - added by onthefloor March 12, 2009 01:55AM UTC.
  • test.html (0.8 KB) - added by onthefloor March 12, 2009 01:55AM UTC.

    example html

Change History (4)

Changed March 11, 2009 08:14PM UTC by onthefloor comment:1

I forgot the essence.

The #preLoadDiv layout was changing the display option to block, but when the page was loaded, the layout wasnt changing to hide.

Changed March 11, 2009 11:56PM UTC by dmethvin comment:2

Can you put together a complete example with html and script? The snippet you have there isn't clearly showing a problem.

Changed March 12, 2009 02:03AM UTC by onthefloor comment:3

Hi,

I attached an example html file.

Try it first with the 1.3.2 version, then with the 1.3.1

Have you got an idea ?

Changed August 09, 2009 01:37AM UTC by dmethvin comment:4

resolution: → invalid
status: newclosed

That is a really bad way to chain event handlers. Instead of addLoadEvent, just use $(document).load() or $(document).ready().