Forum de discussion
Forum « Programmation Javascript » (archives)
A l'aide! pb affichage menu avec Netscape ...
Envoyé: 10 décembre 2003, 4h47 par k3nshin
J'ai un probleme avec un menu qui fonctionne nickel sur IE mais qui ne s'affiche pas avec Netscape ...
J'ai cherché le plus de renseignements possibles sur le net, mais là, je suis a court d'idées, et je quémande votre aide :)
merci d'avance, voici le code :
[code]
<script LANGUAGE="JavaScript">
<!-- hide
sections = new Array();
actives = new Array();
var nv_name = "Default";
var nv_version = 0.0;
var nbr_sections = 4;
function createMenu(section){
section = "SEC" + section;
if(actives[section][0]){
actives[section][0] = 0;
}
else{
actives[section][0] = 1;
}
createHTML();
if(nv_name == "IE"){
document.all.menu.innerHTML = HTML;
}
if(nv_name == "Netscape"){
document.menu.document.open();
document.menu.document.write(HTML);
document.menu.document.close();
}
}
function createHTML() {
HTML = "";
HTML += "<TABLE WIDTH=100% CELLPADDING=1 CELLSPACING=0 BORDER=0>";
HTML += "<TR><TD ALIGN=Center>";
HTML += "<A HREF=\"/asp/acc.asp\" TARGET=\"_top\"><IMG SRC=\"/images/id-net.gif\" BORDER=0 WIDTH=113 HEIGHT=24></A>";
HTML += "</TD></TR>";
HTML += "</TABLE>";
HTML += "<TABLE WIDTH=100% CELLPADDING=5 CELLSPACING=0 BORDER=0><TR><TD>";
HTML += "<TABLE WIDTH=100% CELLPADDING=0 CELLSPACING=0 BORDER=0>";
HTML += "<TR><TD>";
HTML += "<TABLE WIDTH=100% CELLPADDING=1 CELLSPACING=0 BORDER=0>";
for(i=1;i<=nbr_sections;++i){
sec_act = "SEC" + i;
sec_act2 = sec_act ;
HTML += "<TR>";
if([sec_act][0]=="SEC1"){
HTML += "<TD CLASS=\"sections\"><IMG SRC=\"/images/puce.gif\" BORDER=0 WIDTH=6 HEIGHT=6> ";
HTML += "<A HREF=\"" + sections[sec_act][1] + ";\" ONCLICK=\"top.frames['main'].location.href='/adsl2/produits.html'\"><B>" + sections[sec_act][0] + "</B></A></TD>";
HTML += "</TR>";
}
else{
HTML += "<TD CLASS=\"sections\"><IMG SRC=\"/images/puce.gif\" BORDER=0 WIDTH=6 HEIGHT=6> ";
HTML += "<A HREF=\"" + sections[sec_act][1] + "\"><B>" + sections[sec_act][0] + "</B></A></TD>";
HTML += "</TR>";
}
if(actives[sec_act][0]){
for(var key in sections[sec_act]){
if(key != 0 && key != 1){
if(sec_act == "SEC1" || sections[sec_act][key][1] == "/asp/main.asp"){
sse_lie = "<A HREF=\"JAVASCRIPT:goMenu('" + sections[sec_act][key][1]+"?SSec_ID=" + sections[sec_act][key][2] +"&Cat_ID=" + sections[sec_act][key][3] +"')\">";
}
else{
sse_lie = "<A HREF=\"" + sections[sec_act][key][1] + "\" TARGET=\"main\">";
}
HTML += "<TR>";
HTML += "<TD CLASS=\"ssections\"> ";
HTML += sse_lie + sections[sec_act][key][0] + "</A></TD>";
HTML += "</TR>";
}
}
}
}
HTML += "</TABLE>";
HTML += "</TD></TR>";
HTML += "</TABLE>";
HTML += "</TD></TR>";
HTML += "</TABLE>";
HTML += "<TABLE WIDTH=100% CELLPADDING=1 CELLSPACING=0 BORDER=0>";
HTML += "<TR><TD> ";
HTML += "</TD></TR>";
HTML += "</TABLE>";
}
function goMenu(url){
parent.main.location = url;
}
actives["SEC0"] = new Array();
actives["SEC0"][0] = 0;
actives["SEC1"] = new Array();
actives["SEC1"][0] = 0;
sections["SEC1"] = new Array();
sections["SEC1"][0] = "PRÉSENTATION";
sections["SEC1"][1] = "JAVASCRIPT:goMenu('/idnet.html')";
sections["SEC1"]["SSE0"] = new Array();
sections["SEC1"]["SSE0"][0] = "";
sections["SEC1"]["SSE0"][1] = "";
sections["SEC1"]["SSE0"][2] = "";
sections["SEC1"]["SSE0"][3] = "1";
actives["SEC2"] = new Array();
actives["SEC2"][0] = 0;
sections["SEC2"] = new Array();
sections["SEC2"][0] = "CONTACT";
sections["SEC2"][1] = "JAVASCRIPT:createMenu('2')";
sections["SEC2"]["SSE1"] = new Array();
sections["SEC2"]["SSE1"][0] = "Commercial";
sections["SEC2"]["SSE1"][1] = "/idnet/contactcom.html";
sections["SEC2"]["SSE1"][2] = "54";
sections["SEC2"]["SSE1"][3] = "1";
sections["SEC2"]["SSE2"] = new Array();
sections["SEC2"]["SSE2"][0] = "Technique";
sections["SEC2"]["SSE2"][1] = "/idnet/contacttech.html";
sections["SEC2"]["SSE2"][2] = "55";
sections["SEC2"]["SSE2"][3] = "1";
actives["SEC3"] = new Array();
actives["SEC3"][0] = 0;
sections["SEC3"] = new Array();
sections["SEC3"][0] = "PLAN D'ACCÈS";
sections["SEC3"][1] = "JAVASCRIPT:goMenu('/idnet/acces.html')";
sections["SEC3"]["SSE3"] = new Array();
sections["SEC3"]["SSE3"][0] = "";
sections["SEC3"]["SSE3"][1] = "";
sections["SEC3"]["SSE3"][2] = "";
sections["SEC3"]["SSE3"][3] = "1";
actives["SEC4"] = new Array();
actives["SEC4"][0] = 0;
sections["SEC4"] = new Array();
sections["SEC4"][0] = "AGENCES";
sections["SEC4"][1] = "JAVASCRIPT:goMenu('/idnet/agences.html')";
sections["SEC4"]["SSE4"] = new Array();
sections["SEC4"]["SSE4"][0] = "";
sections["SEC4"]["SSE4"][1] = "";
sections["SEC4"]["SSE4"][2] = "";
sections["SEC4"]["SSE4"][3] = "1";
// -->
</SCRIPT>
</head>
<body OnLoad="createMenu('0')" TEXT="White" LINK="White" VLINK="White" ALINK="White" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH="0" MARGINHEIGHT="0" BGCOLOR="Black" BACKGROUND="/images/menu_gauche/idnet.gif">
</body>
[/code]
Réponses
|