Closed
Bug 151875
Opened 22 years ago
Closed 22 years ago
javascript not supported
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
CLOSED
INVALID
People
(Reporter: winny.sylvain, Assigned: rogerl)
References
()
Details
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.0) Gecko/20020530
BuildID: 2002253012
the menu didn't expand with javascript:
the item Hobbies should expand normally, that is ok with IE
<script language=javascript>
<!--
var Open = "images/dossierOuvert.gif"
var Closed = "images/dossierFerme.gif"
function preload(){
if(document.images){
Open = new Image(20,20);
Closed = new Image(20,20);
Open.src = "images/dossierOuvert.gif";
Closed.src = "images/dossierFerme.gif";
}
}
function showhide(what,what2){
preload();
if (what.style.display=='none'){
what.style.display='';
what2.src=Open.src;
}
else{
what.style.display='none';
what2.src=Closed.src;
}
}
-->
</SCRIPT>
Reproducible: Always
Steps to Reproduce:
1.go to the url: http://perso.wanadoo.fr/sylvainlepetit
2.
3.
Comment 1•22 years ago
|
||
The menu is from http://perso.wanadoo.fr/sylvainlepetit/menu.htm
The "Hobbies" folder is given by:
<span id=layerHobbies onclick=showhide(ssmenuHobbies,hobbiesImage) etc. >
When we click on the "Hobbies" folder, we get this error in
Mozilla > Tools > Web Development > JavaScript Console:
Error: ssmenuHobbies is not defined
The element |ssmenuHobbies| is given in the HTML by
<span id=ssmenuHobbies style="DISPLAY: none">
The problem is caused by the way this function is called:
onclick=showhide(ssmenuHobbies,hobbiesImage)
The W3C-standard way to access an HTML element with id="ssmenuHobbies"
is to do |document.getElementById("ssmenuHobbies")|. By using the id
without any qualification, as above, you are expecting that the HTML id
has somehow become a global variable in the JavaScript for the page.
This works in IE, because IE automatically puts every HTML id into the
JavaScript namespace, so you can just say |ssmenuHobbies| instead of
|document.getElementById("ssmenuHobbies")|.
This is not W3C-standard, however, and Mozilla does not support this.
Have to mark this one invalid, because Mozilla is following the standard,
and the HTML here is relying on IE-only syntax -
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → INVALID
Comment 2•22 years ago
|
||
Marking Verified.
Thank you for this report; this issue has occurred with others, too -
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 3•22 years ago
|
||
Thanks for answer, the problem came from my javascript code, it is corrected now.
Status: VERIFIED → CLOSED
You need to log in
before you can comment on or make changes to this bug.
Description
•