Closed
Bug 164217
Opened 23 years ago
Closed 23 years ago
body onLoad not fired when a reference to javascript files exists in the header and body sections and the <script> tag is closed in different way in both sections.
Categories
(Core :: DOM: Events, defect)
Tracking
()
VERIFIED
DUPLICATE
of bug 151506
People
(Reporter: quentin.anciaux, Assigned: joki)
Details
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.0.0) Gecko/20020530
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; fr-FR; rv:1.0.0) Gecko/20020530
The body onload event is not fired if a tag <script src="....js"
language="javascript"/> is in the header section and another tag <script
src="....js" language="javascript"></script> (closed differently) is also in
the body.
Example 1 (the following onload will not be executed) :
<html>
<head>
<title>Event onload not fired</title>
<script src="utilities1.js" language="javascript"/>
<head/>
<body onLoad="alert('ceci est un message');">
<script src="utilities2.js" language="javascript"></script>
</body>
</html>
Example 2 (the following onload will be executed) :
<html>
<head>
<title>Event onload not fired</title>
<script src="utilities1.js" language="javascript"/>
<head/>
<body onLoad="alert('ceci est un message');">
<script src="utilities2.js" language="javascript"/>
</body>
</html>
Example 3 (the following onload will be executed) :
<html>
<head>
<title>Event onload not fired</title>
<script src="utilities1.js" language="javascript"></script>
<head/>
<body onLoad="alert('ceci est un message');">
<script src="utilities2.js" language="javascript"/>
</body>
</html>
Example 4 (the following onload will be executed) :
<html>
<head>
<title>Event onload not fired</title>
<script src="utilities1.js" language="javascript"></script>
<head/>
<body onLoad="alert('ceci est un message');">
<script src="utilities2.js" language="javascript"></script>
</body>
</html>
The bug appear in mozilla ID:2002031104, 2002053012
and also in netscape 6 and 7,
IE 6 seems to handle it correctly.
Quentin Anciaux & Benoit Jauquet
Pulsar Consulting
Reproducible: Always
Steps to Reproduce:
1.test the example pages
2.
3.
Actual Results:
The first test failed, the onload event is not fired.
Expected Results:
execute the onload event.
Reporter | ||
Comment 2•23 years ago
|
||
If you look carefully you'll see that all <script> tag are closed,
either by </script>
or like this <script/>, which is correct also I think.
Comment 3•23 years ago
|
||
No, it's not correct for HTML.
*** This bug has been marked as a duplicate of 151506 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
"/>" denotes that a tag has no contents (and in XML-based languages only, not in
plain old HTML), not a closing tag. Closing tag is denoted by "</".
Verified dupe.
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 5•23 years ago
|
||
Thank you for the answer.
But there's still something that is strange with this,
Example, add a button in the page and add an onclick event on it to a function
contained in either the first or the second .js file, and change the onload
event to call the same function as the button, the onload event is not fired
(normal because </script> is not present for the first ".js") but the onclick
works...
You need to log in
before you can comment on or make changes to this bug.
Description
•