pthompson2002
08-06-2002, 08:54 AM
I am having problems getting an if statement to work. I have a page split into three frames: a menu frame (known as toc.htm), a header frame (menu.htm) and a main_window (known as fcont_login.htm). I don't want the page to display a count down clock when the main window (knwon as maintask) is fcont_login.htm. When it is any other page I want it to display the timer. I thought this would be a simple if (below) but I can't get it to work, it doesn't display the counter on any page and says there are JavaScript errors! Help is needed!!
cheers Pete
--the code--
<script language="javascript">
if (!(parent.maintask.location == fcont_login.htm))
{
document.write('<td valign=bottom width=16%> <font size=2><b>Auto Logoff in:</b></font></td>');
if (document.layers)
{
document.write('<td valign=bottom width=12%><ilayer id="ns4timer"><layer id="ns4timer2" width=100%> </layer></ilayer></td>');
}
if (document.all)
{
document.write('<td valign=bottom><div id="timer"> </div></td>');
}
if (document.getElementById && document.createRange)
{
document.write('<td valign=bottom><div id="N6timer"> </div></td>');
}
} else
{
if (parent.maintask.location.href == fcont_login.htm)
{
document.write('<td></td>');
}
}
</script>
cheers Pete
--the code--
<script language="javascript">
if (!(parent.maintask.location == fcont_login.htm))
{
document.write('<td valign=bottom width=16%> <font size=2><b>Auto Logoff in:</b></font></td>');
if (document.layers)
{
document.write('<td valign=bottom width=12%><ilayer id="ns4timer"><layer id="ns4timer2" width=100%> </layer></ilayer></td>');
}
if (document.all)
{
document.write('<td valign=bottom><div id="timer"> </div></td>');
}
if (document.getElementById && document.createRange)
{
document.write('<td valign=bottom><div id="N6timer"> </div></td>');
}
} else
{
if (parent.maintask.location.href == fcont_login.htm)
{
document.write('<td></td>');
}
}
</script>