AirNav Systems Forum

AirNav RadarBox and RadarBox24.com => AirNav RadarBox and RadarBox24.com Discussion => Topic started by: Burnley on July 24, 2011, 02:38:03 PM

Title: FTP Upload and Image Auto Refresh
Post by: Burnley on July 24, 2011, 02:38:03 PM
Having read this excellent topic here:  http://www.airnavsystems.com/forum/index.php?topic=1385.15

Has anyone got the code to refresh the image only?  I'm using javascript at the moment which seems to be working, but i'm concerned it may not behave in all browsers and I "borrowed" the code from a similar site also seemed to have "borrowed" it.

I don't want to refresh the entire page as I will be making the page more pretty when I have time.

My radar is here: http://www.aviationweb.net/burnley-radar/
Title: Re: FTP Upload and Image Auto Refresh
Post by: Aerotower on July 24, 2011, 03:21:47 PM
<html>
<head>
<meta name="keywords" content="Portmahomack, Airnav, Radarbox, SBS1, SBS-1">
<meta http-equiv="refresh" content="60">
<meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta http-equiv="Pragma-directive" content="no-cache">
<meta http-equiv="Cache-Directive" content="no-cache">
<img hspace="0" src="http://www.radscan.org/radar/RadarBoxScreenShot.gif<%=(new java.util.Date()).getTime()%>"
</html>
Title: Re: FTP Upload and Image Auto Refresh
Post by: tarbat on July 24, 2011, 03:29:34 PM
Aerotower, just wonder why you have "Portmahomack" in your meta tags ;)

Here's the code I use to guarantee auto-update of the page and image.  No idea how you refresh just the image without a page refresh.

Code: [Select]
<html>
<head>
<meta name="keywords" content="Portmahomack, Airnav, Radarbox, SBS1, SBS-1">
<meta http-equiv="refresh" content="60">
<meta http-equiv="expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta http-equiv="Pragma-directive" content="no-cache">
<meta http-equiv="Cache-Directive" content="no-cache">
<body bgcolor="#000000">
<p align="center"><font color="#ff8000"></font></p>
<p align="center"><font color="#ff8000"><img hspace="0" src="http://www.tarbat.gofreeserve.com/shot/RadarBoxScreenShot.gif?<%=(new java.util.Date()).getTime()%>" align=center border=2></font></p><font color="#ff8000" >
<hr>
<p align="center"> </font><font color="#ff8000" size="4">This is a live feed from my Airnav Radarbox</font></p>
</body>
</html>
Title: Re: FTP Upload and Image Auto Refresh
Post by: Aerotower on July 24, 2011, 04:04:19 PM
:D

I saw this in your post, and changed slightly, but I did not change this part.

Thanks Tarbat
Title: Re: FTP Upload and Image Auto Refresh
Post by: Burnley on July 24, 2011, 05:29:27 PM
This is the source for my webpage to make the image only auto-refresh.  I borrowed the javascript.  It works, just not sure if it's right for all browsers.  I've not coded for years:

Quote
<html>
<head>
<title>AirNav RadarBox 3D - Burnley in Lancashire, England</title>
</head>
<body bgcolor="000000">
 
<center>
<br>
<br>
<font color="FFFFFF">
The radar will auto-refresh - Return to the <a href="http://www.aviationweb.net/">Aviation Web Forum</a>.
<br>
<br>
</font>
<img src="RadarBoxScreenShot.gif" alt="Live AirNav RadarBox 3D" name="refresh" border="0">
<script language="JavaScript" type="text/javascript">
      <!--
      var t = 30 // interval in seconds
      image = "RadarBoxScreenShot.gif" //name of the image
      function Start() {
      tmp = new Date();
      tmp = "?"+tmp.getTime()
      document.images["refresh"].src = image+tmp
      setTimeout("Start()", t*1000)
      }
      Start();
      // -->
      </SCRIPT>
</center>
</body>
</html>