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)
Tracking
()
RESOLVED
DUPLICATE
of bug 140267
People
(Reporter: doronr, Assigned: joki)
Details
Attachments
(1 file)
|
347 bytes,
text/html
|
Details |
<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.
Comment 1•23 years ago
|
||
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.
| Reporter | ||
Comment 2•23 years ago
|
||
| Reporter | ||
Comment 3•23 years ago
|
||
Well, this is causing me some trouble in fixing china sites.
bc, any thoughts? I have a workaround if need be.
Comment 4•23 years ago
|
||
doron, your test case does not work in IE6/win2k. I say we don't worry about it.
| Reporter | ||
Comment 5•23 years ago
|
||
works fine in ie5.5/win2k. Up to you guys. Might be just my messed up box :)
Comment 6•22 years ago
|
||
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.
Description
•