Originariamente inviato da CCC
Qualcuno di voi riuscirebbe a dirmi perché questo script funziona bene su Firefox ma non su Internet Explorer 6.0??
Ho verificato tutte le funzioni utilizzate e sono ampiamente supportate da IE!
:master:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
.selected {
font-weight:bold;
color:#339900;
background-color:#FFFFCC;
}
</style>
<script language="javascript" type="text/javascript">
function sceltaMenu(label) {
// CONFIGURAZIONE: INSERIRE L'ID DEL MENU
var idmenu = "menusx";
// controllo se il browser supporta il DOM di livello 1 del W3C
if(document.getElementById) {
// normalizzo la stringa di input
var pointer = label.toString();
var objmenu = document.getElementById(idmenu).getElementsByTagNa me('a');
if (1==1){
var i = 0;
var dimmenu = objmenu.length;
for (i=0; i<dimmenu; i++){
var tagA = objmenu[i].firstChild.nodeValue;
// normalizzo anche il valore della label del menu
var tagAs = tagA.toString();
if (tagAs.toLowerCase()==pointer.toLowerCase()) {
objmenu[i].parentNode.setAttribute("class", "selected");
}
}
}
return;
}
else {
alert("DOM non Supportato!");
return;
}
}
</script>
</head>
<body onload="javascript
:sceltaMenu('natura');">
<ul id="menusx">[*]
introduzione[*]
montagne[*]
valichi e trafori[*]
natura[*]
storia[*]
cultura[*]
terra e sapori[*]
persone[*]
sport[/list]
altro testo...</p>
</body>
</html>
Grazie!