I have a site that is supposed to be 'real-time' which has a frameset
of 2 rows (the bottom row is 1 pixel so essentially invisible to IE
users which is the requirement for the product). The bottom frame
refreshes using an http-refresh every 15 seconds. If new data is
available on the server, it tells the top page to refresh. For checks
and balances, the top frame has a form at the bottom of the page with a
'clockBox'..which is essentially a text box that gets updated every
second so it looks like a timer. When the bottom frame refreshes, it
waits 5 seconds then resets the top counter to 0. The top counter
continues to count. If the top counter gets to 30 (which it never
should unless the bottom frame gets stuck), it refreshes the bottom
frame.
My problem:
When the top frame is taking too long to load, I get a javascript
error:
Error: 'window.parent.frames.body.coutnerFomr.clockBox' is null or not
an object.
Here's my code:
<script language="javascript">
timer = setTimeout("setCounter()",8000);
function setCounter(){
if (window.parent.frames["body"].counterForm.clockBox){
window.parent.frames["body"].counterForm.clockBox.value = 0;
}
}
</script>