Hello, I'm guessing this is best sorted using JS so I asked it here after searching the site.
Here is what I am doing:
I have a php page called "time.php" that simply gets the server time and displays it.
I have a second page called "clock.php". This page will eventually have a flash analog clock on it that displays the server time using the time.php script. As the time.php page needs to be refreshed every second, I thought the only way to refresh it with out reloading the entire page is to put the time.php script into an iFrame and refresh that.
I'll keep it basic for now, so don't worry about the flash clock, all I want to do for now, is display the output of the time.php page in the iframe and refresh that iframe every second.
I have tried putting the meta refresh tag in the time.php page, which works, but it seems to refresh the entire clock.php too. (The status bar looks that way anyway and the hourglass mouse pointer comes up every second)
Is there away that I can just refresh time.php in iframe by itself?
Thanks
Aaron
Here is what I am doing:
I have a php page called "time.php" that simply gets the server time and displays it.
Code:
time.php
<?php
printf("serverTime=%d000", time());
?>
I have a second page called "clock.php". This page will eventually have a flash analog clock on it that displays the server time using the time.php script. As the time.php page needs to be refreshed every second, I thought the only way to refresh it with out reloading the entire page is to put the time.php script into an iFrame and refresh that.
Code:
clock.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
background-color: #003399;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body>
<iframe src="time.php" style="margin-left: 30px;" frameborder="0" id="time" name="time" height="40" width="290" hspace="0" vspace="0" scrolling="no"></iframe>
</body>
</html>
I'll keep it basic for now, so don't worry about the flash clock, all I want to do for now, is display the output of the time.php page in the iframe and refresh that iframe every second.
I have tried putting the meta refresh tag in the time.php page, which works, but it seems to refresh the entire clock.php too. (The status bar looks that way anyway and the hourglass mouse pointer comes up every second)
Is there away that I can just refresh time.php in iframe by itself?
Thanks
Aaron