DanUK
08-03-2003, 08:22 AM
Hi can anyone tell me what's wrong with this please? I get some of my visitors getting errors which state:
Object doesn't support this property or method
line 260
char 3
line260 of my site was: document.getElementById('ag_clock').innerHTML = s + post;
<script type="text/javascript">
<!-- /* Clock */
// Change the variables below to your preferences.
// If you do not know what a variable does, leave the default.
// Use quoted strings for these variables:
var ClockColor = "grey";
var ClockBackground = "transparent";
var ClockFont = "Tahoma";
var ClockCustomStyle = "";
var ClockLoadingText = "Loading clock...";
// Use true or false for these variables:
var Clock24Hour = false;
var ClockShowAmPm = true;
var ClockShowSeconds = true;
var ClockPadWithZeros = true;
// Do not change below this line.
var today = new Date();
var hours = today.getHours();
var mins = today.getMinutes();
var secs = today.getSeconds();
document.write('<span id="ag_clock" style="color: ' + ClockColor + '; background: ' + ClockBackground + '; font-family: ' + ClockFont + ';' + ClockCustomStyle + '">' + ClockLoadingText + '</span>');
UpdateClock();
function UpdateClock(){
post = "";
secs++;
if (secs>=60){secs = 0;mins++;}
if (mins>=60){mins = 0;hours++;}
if (hours>=24){hours = 0;}
if (!Clock24Hour && hours > 12){
shours = hours - 12;
} else {
shours = hours;
}
if (shours == 0) shours = 12;
if (ClockShowAmPm && hours < 12) post = " AM";
if (ClockShowAmPm && hours >=12) post = " PM";
if ((shours<10) && ClockPadWithZeros){
s = "0" + shours + ":";
} else {
s = shours + ":";
}
if ((mins<10) && ClockPadWithZeros){
s = s + "0" + mins;
} else {
s = s + mins;
}
if (ClockShowSeconds){
if ((secs<10) && ClockPadWithZeros){
s = s + ":0" + secs;
} else {
s = s + ":" + secs;
}
}
document.getElementById('ag_clock').innerHTML = s + post;
setTimeout("UpdateClock()", 1000);
}
//-->
</script>
Object doesn't support this property or method
line 260
char 3
line260 of my site was: document.getElementById('ag_clock').innerHTML = s + post;
<script type="text/javascript">
<!-- /* Clock */
// Change the variables below to your preferences.
// If you do not know what a variable does, leave the default.
// Use quoted strings for these variables:
var ClockColor = "grey";
var ClockBackground = "transparent";
var ClockFont = "Tahoma";
var ClockCustomStyle = "";
var ClockLoadingText = "Loading clock...";
// Use true or false for these variables:
var Clock24Hour = false;
var ClockShowAmPm = true;
var ClockShowSeconds = true;
var ClockPadWithZeros = true;
// Do not change below this line.
var today = new Date();
var hours = today.getHours();
var mins = today.getMinutes();
var secs = today.getSeconds();
document.write('<span id="ag_clock" style="color: ' + ClockColor + '; background: ' + ClockBackground + '; font-family: ' + ClockFont + ';' + ClockCustomStyle + '">' + ClockLoadingText + '</span>');
UpdateClock();
function UpdateClock(){
post = "";
secs++;
if (secs>=60){secs = 0;mins++;}
if (mins>=60){mins = 0;hours++;}
if (hours>=24){hours = 0;}
if (!Clock24Hour && hours > 12){
shours = hours - 12;
} else {
shours = hours;
}
if (shours == 0) shours = 12;
if (ClockShowAmPm && hours < 12) post = " AM";
if (ClockShowAmPm && hours >=12) post = " PM";
if ((shours<10) && ClockPadWithZeros){
s = "0" + shours + ":";
} else {
s = shours + ":";
}
if ((mins<10) && ClockPadWithZeros){
s = s + "0" + mins;
} else {
s = s + mins;
}
if (ClockShowSeconds){
if ((secs<10) && ClockPadWithZeros){
s = s + ":0" + secs;
} else {
s = s + ":" + secs;
}
}
document.getElementById('ag_clock').innerHTML = s + post;
setTimeout("UpdateClock()", 1000);
}
//-->
</script>