L
Leila
Folks
I have an html file which looks like this:
..
..
..
<body onLoad="WindowOnLoad();">
..
..
..
<div id="strategy_asp" style="visibility:hidden;">HTML CODE HERE</div>
<div id="organisation_asp" style="visibility:hidden;">HTML CODE
HERE</div>
<div id ="people.asp" style="visibility:hidden;">HTML CODE HERE</div>
..
..
..
I also have a javascript function which retrieves the URL of the page
you're on and should then display the appropriate content for that
page:
function WindowOnLoad() {
// this function will detect what page I am on using the javascript
href function
// and then depending on the outcome, it will switch the <div> tag for
that particular page
// on or off
var src = self.location.href;
src = (src.substring(src.lastIndexOf("/") + 1,
src.length).toLowerCase());
// replace "." in URL with "_"
src = src.replace('.', '_')
if (document.layers) {
eval("document.layers['" + src + "'].style.visibility = 'show';");
} else if(document.all) {
eval("document.all." + src + ".style.visibility = 'visible'");
} else if(document.getElementById) {
eval("document.getElementById('" + src + "').style.style.visibility =
'visible';");
}
}
However, I keep getting this error when I click on strategy.asp, for
example:
document.all.strategy_asp.style is null or not an object
This is infuriating. What am I doing wrong???
I have an html file which looks like this:
..
..
..
<body onLoad="WindowOnLoad();">
..
..
..
<div id="strategy_asp" style="visibility:hidden;">HTML CODE HERE</div>
<div id="organisation_asp" style="visibility:hidden;">HTML CODE
HERE</div>
<div id ="people.asp" style="visibility:hidden;">HTML CODE HERE</div>
..
..
..
I also have a javascript function which retrieves the URL of the page
you're on and should then display the appropriate content for that
page:
function WindowOnLoad() {
// this function will detect what page I am on using the javascript
href function
// and then depending on the outcome, it will switch the <div> tag for
that particular page
// on or off
var src = self.location.href;
src = (src.substring(src.lastIndexOf("/") + 1,
src.length).toLowerCase());
// replace "." in URL with "_"
src = src.replace('.', '_')
if (document.layers) {
eval("document.layers['" + src + "'].style.visibility = 'show';");
} else if(document.all) {
eval("document.all." + src + ".style.visibility = 'visible'");
} else if(document.getElementById) {
eval("document.getElementById('" + src + "').style.style.visibility =
'visible';");
}
}
However, I keep getting this error when I click on strategy.asp, for
example:
document.all.strategy_asp.style is null or not an object
This is infuriating. What am I doing wrong???