Forum Moderators: open
<script language="JavaScript1.2">
function hideshow(which){
if (!document.getElementById)
return
if (which.style.display=="none")
which.style.display=""
else
which.style.display="none"
}
function hide(which){
if (!document.getElementById)
return
if (which.style.display=="")
which.style.display="none"
}
</script>
<div id="otherSub" style="display:none;">
<a href="#">Lampor</a>
<a href="#">Hyllor</a>
<a href="#">Prydnad</a>
<a href="#">Rotting</a>
<a href="#">Utemöbler</a>
</div>
<div id="sortimentSub" style="display:none;">
<a href="tablesDine/tablesDine.asp" id="matbord">MATBORD</a>
<a href="#" id="soffor" onClick="javascript:hide(document.getElementById('otherSub'))">SOFFOR</a>
<a href="#" id="soffbord" onClick="javascript:hide(document.getElementById('otherSub'))">SOFFBORD</a>
<a href="#" id="skap" onClick="javascript:hide(document.getElementById('otherSub'))">SKÅP</a>
<a href="#" id="sangar" onClick="javascript:hide(document.getElementById('otherSub'))">SÄNGAR </a>
<a href="#" id="smide" onClick="javascript:hide(document.getElementById('otherSub'))">SMIDE</a>
<a href="#" id="konst" onClick="javascript:hide(document.getElementById('otherSub'))">KONST</a>
<a href="#" id="ovrigt" onClick="javascript:hideshow(document.getElementById('otherSub'))">ÖVRIGT</a>
</div>
<div id="mainMenu">
<a href="#" id="sortiment" onClick="javascript:hideshow(document.getElementById('sortimentSub'))">SORTIMENT</a>
<a href="#" id="butiken" onClick="javascript:hide(document.getElementById('sortimentSub'))">BUTIKEN</a>
<a href="#" id="leverantorer" onClick="javascript:hide(document.getElementById('sortimentSub'))">LEVERANTÖRER</a>
<a href="#" id="kontakta" onClick="javascript:hide(document.getElementById('sortimentSub'))">KONTAKTA OSS</a>
<a href="#" id="startsidas" onClick="javascript:hide(document.getElementById('sortimentSub'))">STARTSIDA</a>
</div>
For instance, if file1.asp is in the root of your directory and file2.asp is within a folder within the directory, then the include will not work in both.
You have used the include in index.asp which is your main homepage i assume. The includes will work fine and will link to, for example, /tablesDine/index.asp without any problems.
However, when you are in tablesDine/index.asp your include won't work. It is looking for the directory 'tablesdine' within the tablesdine folder - which doesn't exist....... does this make sense?
An easy way around this is to have 2 versions of your include file. The first for all root files i.e. your homepage, and the second for all files located within sub-directories.
You will have to make sure the 2nd include has the correct paths to the relevant files. This could be as simple as adding a ../ in front of the current path name.
Hope this helps!