Closed Bug 96926 Opened 24 years ago Closed 24 years ago

onLoad fired before document has finished loading

Categories

(Core :: DOM: Events, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 93015

People

(Reporter: jason, Assigned: joki)

Details

Attachments

(1 file)

Under mozilla 0.9.3 it appears that my document.body.onLoad event handler is being called well before the document has loaded. As I understand it, the onLoad event should not be fired until the entire page and all of it's images are loaded and displayed.
This only happens if I do the following: document.location.replace("foo.html"); document.onload = alert("e"); The "e" appears before the document is loaded.
Made a simple testcase with your code and it worked exactly the same as in IE....
Vladimire: In the interest of triaging Unconfirms, should this bug be marked WONTFIX, INVALID, NEW, or what?
I have been away for a couple of days, but I'm certain that I can make a test case to recreate this bug. I'll try to have it for you later today / tomorrow. Until then, Unconfirmed seems the most correct.
I've just attached a test case for this bug that illustrates what I'm trying to do. However, I've discovered that the problem also occurs in Netscape 4.75. Maybe the code I've written is wrong, but it seems to match the examples so I'm stymied. I'm using mozilla 0.9.3
I just put an example of this at: http://www.kaply.com/work/onload.html I can't really reduce the testcase yet. I put two alerts in that show the problem. There is an INPUT field whose value is set to 2. The alert shows this INPUT fields value. On 4.x it properly shows 2, on Mozilla, it shows 0.
Marking NEW.
Status: UNCONFIRMED → NEW
Ever confirmed: true
dupe of 93015 or vice versa?
yes, dup of 93015 *** This bug has been marked as a duplicate of 93015 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: