Ciao a tutti.
Ho un problema sul codice per la realizzazione del menu ad albero.
E' un codice Javascript diffusissimo sul web (tra l'altro scaricabile anche da Html.it!)

Ho una pagina jsp che riporta il file system del server, con cartelle e files.
Ha sempre funzionato egregiamente con tutti i browser.

In locale su macchina Windows funziona con tutti i browser: MS IE, Chrome e FFox.

Porto l'applicazione in produzione, su una macchina Linux Ubuntu 7.04 e funziona solo con Chrome e FFox!!!
Con il browser IExplorer mi restituisce l'errore:

Messaggio: 'style' è nullo o non è un oggetto
Linea: 210
Carattere: 1
Codice: 0


--------------------ecco il codice----------------------------------------

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){ <========== QUI E' L'ERRORE!!
foldercontent.style.display=""
cur.style.listStyleImage="url(/WebTimesheet/images/open.gif)"

---------------------------------------------------


Non mi spiego come mai non funzioni con IE su Linux e con gli altri browser non ci sia problema.
Mentre su windows funziona bene con tutti i browser. Qualcuno mi sa spiegare il motivo?

Grazie anticipatamente

Alex

-----------ecco il codice completo dell'html-----------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style>
a:link {font-family:verdana; text-decoration: none; color: #000000; font-size: 10pt;}
a:visited {font-family:verdana; text-decoration: none; color: #000000; font-size: 10pt;}
a:hover {font-family:verdana; text-decoration: none; color: #000000; font-size: 10pt;}
</style>

<script language="javascript" src="js/timeJs.js"></script>
<script language="javascript" src="js/menu.js"></script>
<script language="javascript">

var pathRisorsa = '';
/*voci delle azioni
1 = creaDirectory
2 = upload
3 = renameDir
4 = renameFile
*/
function esegui(azione) {
var nuovoValore = document.frmPagina.valore.value;
if (checkNomeFile(nuovoValore)) { //nome valido
if (azione==1) { //creaDirectory
document.frmPagina.action="creaDirectory.action";
document.frmPagina.submit();
} else if (azione == 2) { //upload di file
if (document.frmPagina.valore.value=='') {
alert('Selezionare il file da caricare sul server.');
} else {
document.frmPagina.action="uploadFile.action";
document.frmPagina.submit();
}
} else if (azione == 3) { //rename Directory
document.frmPagina.action="renameDirectory.action" ;
document.frmPagina.submit();
} else if (azione == 4) { //renameFile
document.frmPagina.action="renameFile.action";
document.frmPagina.submit();
}
} else { //nome non valido
alert("Valore immesso non valido.\nControllare che non ci siano caratteri non ammessi.");
}

}

function visualizzaDirectory(path){
//alert("debug visualizzaDirectory("+path+")");
var elem = document.getElementById("percorsoSelezionato");
elem.innerHTML="<font face='verdana' size='2'>Cartella: "+path+"</font>";
document.getElementById("inputForm").innerHTML="";
document.getElementById("pathSelezionato").value=" "+path;
//alert("debug 1 adesso vale..."+document.getElementById('pathSelezionato' ).value);
}

function visualizzaFile(path){
//alert("debug visualizzaFile("+path+")");
var elem = document.getElementById("percorsoSelezionato");
elem.innerHTML="<font face='verdana' size='2'>File: "+path+"</font>";
document.getElementById("inputForm").innerHTML="";
document.getElementById("pathSelezionato").value=" "+path;
//alert("debug 2 adesso vale..."+document.getElementById('pathSelezionato' ).value);
}

function creaDirectory() {
var elem = document.getElementById("percorsoSelezionato");
if (elem.innerHTML.match('Cartella: ')) {
var inputForm = document.getElementById("inputForm");
document.getElementById("inputForm").innerHTML="Nuova cartella: <input type='text' name='valore' value='' size='20'> <input type='button' name='bottone' value='OK' onclick='esegui(1);'>";
} else {
alert('Selezionare una cartella, dentro la quale creare la nuova directory.');
}
}
function download() {

var elem = document.getElementById("percorsoSelezionato");
if (elem.innerHTML.match('File: ')) {
var elementoDaScaricare = document.getElementById("pathSelezionato").value;
document.frmPaginaUpload.fileAllegato.value=""+ele mentoDaScaricare;
document.frmPaginaUpload.target="_blank";
document.frmPaginaUpload.action="/WebTimesheet/views/forms/downloadForms.jsp";
document.frmPaginaUpload.submit();
} else {
alert('Selezionare il file da scaricare.');
}
}

function checkNomeFile(nomeFileDaControllare) {
if (nomeFileDaControllare.indexOf('%')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('!')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('"')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('£')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('$')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('&')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('(')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf(')')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('=')>-1) {
return false;
} else if (nomeFileDaControllare.indexOf('\'')>-1) {
return false;
} else {
return true;
}
}
</script>

<style>
A:link {text-decoration: none; background-color:transparent; }
A:visited { text-decoration: none; background-color:#transparent; }
A:hover { text-decoration: none; background-color:yellow; }
</style>

<style>
#foldheader{cursorointer;cursor:hand ; font-weight:bold ;list-style-image:url(/WebTimesheet/images/fold.gif)}
#foldinglist{list-style-image:url(/WebTimesheet/images/list.gif)}
</style>
<script language="JavaScript1.2">

var head="display:''";
img1=new Image();
img1.src="/WebTimesheet/images/fold.gif";
img2=new Image();
img2.src="/WebTimesheet/images/open.gif";

var ns6=document.getElementById&&!document.all
var ie4=document.all&&navigator.userAgent.indexOf("Ope ra")==-1

function checkcontained(e){
//alert("debug ns6"+ns6+" ie4:"+ie4);
var iscontained=0
cur=ns6? e.target : event.srcElement
i=0
if (cur.id=="foldheader")
iscontained=1
else
while (ns6&&cur.parentNode||(ie4&&cur.parentElement)){
if (cur.id=="foldheader"||cur.id=="foldinglist"){
iscontained=(cur.id=="foldheader")? 1 : 0
break
}
cur=ns6? cur.parentNode : cur.parentElement
}

if (iscontained){
var foldercontent=ns6? cur.nextSibling.nextSibling : cur.all.tags("UL")[0]
if (foldercontent.style.display=="none"){
foldercontent.style.display=""
cur.style.listStyleImage="url(/WebTimesheet/images/open.gif)"
}
else{
foldercontent.style.display="none"
cur.style.listStyleImage="url(/WebTimesheet/images/fold.gif)"
}
}
}

if (ie4||ns6)
document.onclick=checkcontained

</script>
</head>

<body scroll="no" style="background-image:url(/WebTimesheet/images/sfondoSito.jpg);"><form name="frm_menu" method="post" action="">
<input type="hidden" name="prospettivaSel" value='77777777'>
</form>

<form name="frmPagina" method="post" action="" ENCTYPE="multipart/form-data">
<input type="hidden" name="pathSelezionato" id="pathSelezionato" value="">


<div id="headerBacheca" style="position: absolute; left: 175px; top: 80px; width:605px; height:15px; background-color:#eeeeee;">
<table style="background-color:#eeeeee;width:605px; height:15px; border-top:1px solid #000000; border-right:1px solid #000000;border-left:1px solid #000000;border-bottom:1px solid #000000;">
<tr>
<td align="center"><FONT FACE="ARIAL" color="#000000" SIZE="1" >AREA COMUNE FORMS</FONT></td>
</tr>
</table>
</div>

<div id="percorsoSelezionato" style="position: absolute; left: 175px; top: 390px;">Cartella: nessuno</div>

<div id="inputForm" style="position: absolute; left: 175px; top: 410px;"></div>

<div id="contenuto" style="position: absolute; left: 175px; top: 95px; overflow: auto; width:605px; height:290px; background-color:#eeeeee; border-top:1px solid #000000; border-right:1px solid #000000;border-left:1px solid #000000;border-bottom:1px solid #000000;">
<ul><li id='foldheader'>CERTIFICAZIONE ISO <ul id='foldinglist' style='display:none' style=&{head};>[/list]<li id='foldheader'>Qualità <ul id='foldinglist' style='display:none' style=&{head};><li id='foldheader'>pippo <ul id='foldinglist' style='display:none' style=&{head};><li id='foldheader'>aripippo <ul id='foldinglist' style='display:none' style=&{head};>[/list][/list][/list]<li id='foldheader'>XXX_CV <ul id='foldinglist' style='display:none' style=&{head};>[/list][/list]

</div>

</form>

<form name="frmPaginaUpload" method="post" action="">
<input type="hidden" name="fileAllegato" id="fileAllegato" value="">
</form>
</body>
</html>