Closed Bug 163779 Opened 23 years ago Closed 22 years ago

window.onload="foo" killed by <body onload="bar", yet addEventListener works

Categories

(Core :: DOM: Events, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 140267

People

(Reporter: doronr, Assigned: joki)

Details

Attachments

(1 file)

<body onload="bar();"> and in a js file, window.onload=foo. foo never gets run. Even <body onload="" > causes this, only when <body> has no onload does foo get run. window.addEventListener("load", foo, false); does work though. Works fine in IE :) Testcase coming soon.
Does this break any sites? If not, I'd suggest WONTFIX since doing this is unpredictable at best since the page you're loading could do window.onload = bar and then the previously set event handler is cleared and won't be called.
Attached file testcase
Well, this is causing me some trouble in fixing china sites. bc, any thoughts? I have a workaround if need be.
doron, your test case does not work in IE6/win2k. I say we don't worry about it.
works fine in ie5.5/win2k. Up to you guys. Might be just my messed up box :)
I think this is because the events assgined through HTML in the body tag are not appended to the document.body but to documet or window... *** This bug has been marked as a duplicate of 140267 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: