Forum Moderators: open
function StartAstoniaTimer(){
clockID = setTimeout("UpdateAstoniaTimer()", 500);
}
function KillAstoniaTimer(){
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
}
// end hiding contents
-->
-----**--
The html page is:
<html><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<BODY onload="StartAstoniaTimer()" onunload="KillAstoniaTimer()" text=#ffffff bgColor=#000000 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<CENTER>
<!--<SCRIPT SRC="frameenforcer.js">
</SCRIPT>-->
<form name="aTime"></form>
<span id="AstonClock" style="background: #000000; position: absolute; middle: 10; top: 1; color: #C0C7FF; font-weight: bold; font-family: Latha ;"></span>
<SCRIPT LANGUAGE="JavaScript" SRC="ast.js">
</SCRIPT>
<body onload="StartAstoniaTimer()" onunload="KillAstoniaTimer()">
</center>
</body></body>
<html>
Any imput would be appreciated, thank you.
Missing <html> closing tag
Missing <head> section - meta tag belongs in there
Duplicate <body> sections - only one allowed!
And these are just to get you started...
IE is VERY forgiving of bad html coding, but Netscape will choke on it everytime. That may be why it won't work in Netscape even though IE can work it's way through it.
Get your html in compliance, then check your page in Netscape again... it may work.
I recommend using HTML 4.01 transitional or strict (strict is preferable)
Below are the results of attempting to parse this document with an SGML parser.
Line 5, column 70: an attribute value must be a literal unless it contains only name characters (explain...).
..." onunload="KillAstoniaTimer()" text=#ffffff bgColor=#000000 leftMargin=0 top
----------------------------------------^
Line 5, column 86: an attribute value must be a literal unless it contains only name characters (explain...).
...AstoniaTimer()" text=#ffffff bgColor=#000000 leftMargin=0 topMargin=0 marginw
----------------------------------------^
Line 5, column 105: there is no attribute "LEFTMARGIN" (explain...).
...t=#ffffff bgColor=#000000 leftMargin=0 topMargin=0 marginwidth="0" marginheig
----------------------------------------^
Line 5, column 117: there is no attribute "TOPMARGIN" (explain...).
...Color=#000000 leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
----------------------------------------^
Line 5, column 131: there is no attribute "MARGINWIDTH" (explain...).
...leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
----------------------------------------^
Line 5, column 148: there is no attribute "MARGINHEIGHT" (explain...).
...argin=0 marginwidth="0" marginheight="0">
----------------------------------------^
Line 5, column 151: document type does not allow element "BODY" here (explain...).
...in=0 marginwidth="0" marginheight="0">
----------------------------------------^
Line 9, column 18: required attribute "ACTION" not specified (explain...).
<form name="aTime"></form>
------------------^
Line 12, column 42: required attribute "TYPE" not specified (explain...).
<SCRIPT LANGUAGE="JavaScript" SRC="ast.js">
------------------------------------------^
Line 14, column 64: document type does not allow element "BODY" here (explain...).
...d="StartAstoniaTimer()" onunload="KillAstoniaTimer()">
--------------------------------------------------------^
Line 17, column 13: end tag for element "BODY" which is not open (explain...).
</body></body>
-------------^
Line 18, column 5: document type does not allow element "HTML" here (explain...).
<html>
-----^
Line 18, column 7: "HTML" not finished but document ended
<ht...
-------^
Line 18, column 7: "HEAD" not finished but document ended
<ht...
-------^
Line 18, column 7: "HTML" not finished but document ended
<ht...
-------^
Here's the edited html:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title></title>
<style type="text/css">
A:link {COLOR: #00CC33;TEXT-DECORATION: none}
A:visited {COLOR: #00CC33; TEXT-DECORATION: none}
A:hover {COLOR: #00ff00; TEXT-DECORATION: none}
</style>
</head>
<BODY onload="StartAstoniaTimer()" onunload="KillAstoniaTimer()" text="#00CC33" bgColor="#000000">
<script src="header_data/ast.js" type="text/javascript"> </script>
<div id="AstonClock" style="background: #000000; position: absolute; color: ##00CC33; font-weight: bold; font-family: Latha ;"></div>
</body>
</html>
It look better in IE now but netscape won't touch it. *wonders why netscape has to be so difficult with html* :)
But I'm thinking it has something to do with the script itself. I've read somewhere (can't remember where) that netscape can't or won't handle the .innerHTML command but like I said I can't remember if this is right.
AstonClock.innerHTML
into
document.getElementById('AstonClock').innerHTML
and remove the lines
AstonClock.document= "" + astoniaHours +":" + astoniaMinutes + " Aston Standard Time ";
clockID = setTimeout("UpdateAstoniaTimer()", 1000);
because they throw an error and seem useless to me ;)
It runs a bit fast though, your clock...
Also, yes your right, this clock is fast, an hour goes by every 5 min real time, :).