CRASH_OVERRIDE
11-09-2002, 01:25 AM
I am pretty experienced with web design, but these questions may seem stupid since I have just started developing for Mozilla compatability. All the scripts worked fine in IE, but Mozilla wont even call the functions right.
1. I keep getting this second scrollbar inside my document, right next to the main one. Anybody know why?
2. I call working functions properly from an event, and when I do, the JavaScript Console says something like, 'Error: yourFunctionHere not declared'. Any function I call is 'not defined'! From what I see, theyre perfect working functions (again note that this is my first time with Mozilla) Here is how I called one of them:
onmouseover="showMenu('resources');"
The function:
var submenu=document.getElementById('submenuTxt')
//RESOURCES-------------------------------------------
var resourcesItems=new Array();
resourcesItems[0]=new Array("Links","links.htm");
resourcesItems[1]=new Array("Tutorials","tutorials.htm");
resourcesItems[2]=new Array("References","references.htm");
//PROJECTS--------------------------------------------
var projectsItems=new Array();
function showMenu(which) {
var rep=0;
var currentHTML="";
var tempLink=" ";
which.toLowerCase();
switch(which){
case 'resources':
currentHTML="Resources>";
if(resourcesItems.length)
writeItems:
for(rep=0;rep<=resourcesItems.length;rep++){
tempLink+="<a href='"+resourcesItems[rep][1]+"' class='submenuLink'>"+resourcesItems[rep][0]+"</a>";
if(rep!=resourcesItems.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{ break writeItems; }
}
break;
case 'projects':
currentHTML="Projects>";
if(projectsItems.length){
writeItems:
for(rep=0;rep<=projectsItems.length;rep++){
tempLink+="<a href='"+projectsItems[rep][1]+"' class='submenuLink'>"+projectsItems[rep][0]+"</a>";
if(rep!=projectsItems.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{ break writeItems; }
}
}
break;
case 'location':
currentHTML="Location>";
var title=document.title.split(' :: ');
if(title.length){
writeItems:
for(rep=1;rep<=title.length;rep++){
tempLink+=title[rep];
if(rep!=title.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{
var back=title[title.length-1]
tempLink+=" <<a href='javascript:window.go(back)' class='submenuLink'>Back</a>";
break writeItems;
}
}
}
break;
}
submenu.innerHTML=currentHTML+tempLink;
}
Note that I stripped some of the 'case's and other unimportant code, so if Im missing or gained a variable it's because of that
Thank you for any help. :)
1. I keep getting this second scrollbar inside my document, right next to the main one. Anybody know why?
2. I call working functions properly from an event, and when I do, the JavaScript Console says something like, 'Error: yourFunctionHere not declared'. Any function I call is 'not defined'! From what I see, theyre perfect working functions (again note that this is my first time with Mozilla) Here is how I called one of them:
onmouseover="showMenu('resources');"
The function:
var submenu=document.getElementById('submenuTxt')
//RESOURCES-------------------------------------------
var resourcesItems=new Array();
resourcesItems[0]=new Array("Links","links.htm");
resourcesItems[1]=new Array("Tutorials","tutorials.htm");
resourcesItems[2]=new Array("References","references.htm");
//PROJECTS--------------------------------------------
var projectsItems=new Array();
function showMenu(which) {
var rep=0;
var currentHTML="";
var tempLink=" ";
which.toLowerCase();
switch(which){
case 'resources':
currentHTML="Resources>";
if(resourcesItems.length)
writeItems:
for(rep=0;rep<=resourcesItems.length;rep++){
tempLink+="<a href='"+resourcesItems[rep][1]+"' class='submenuLink'>"+resourcesItems[rep][0]+"</a>";
if(rep!=resourcesItems.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{ break writeItems; }
}
break;
case 'projects':
currentHTML="Projects>";
if(projectsItems.length){
writeItems:
for(rep=0;rep<=projectsItems.length;rep++){
tempLink+="<a href='"+projectsItems[rep][1]+"' class='submenuLink'>"+projectsItems[rep][0]+"</a>";
if(rep!=projectsItems.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{ break writeItems; }
}
}
break;
case 'location':
currentHTML="Location>";
var title=document.title.split(' :: ');
if(title.length){
writeItems:
for(rep=1;rep<=title.length;rep++){
tempLink+=title[rep];
if(rep!=title.length-1){
tempLink+=" :: ";
continue writeItems;
}
else{
var back=title[title.length-1]
tempLink+=" <<a href='javascript:window.go(back)' class='submenuLink'>Back</a>";
break writeItems;
}
}
}
break;
}
submenu.innerHTML=currentHTML+tempLink;
}
Note that I stripped some of the 'case's and other unimportant code, so if Im missing or gained a variable it's because of that
Thank you for any help. :)