
February 20th, 2013, 08:01 AM
|
|
Registered User
|
|
Join Date: Feb 2013
Posts: 4
Time spent in forums: 50 m 2 sec
Reputation Power: 0
|
|
How refresh a item in website
Hi there,
I am a passionate weather and I'm creating a website for my weather station.
Because I am a beginner in this world of design pages for websites I'm learning as I go creating pages.
Now I wanted to create a page with the radar image from my area. But that was updated by the minute.
What complicates me more is that the image is in the following direction:
www. meteoelvas . com / RadarIM.php. And the script I'm testing does not work. Loads the image initially, but then will not upgrading to the most recent image, as you can see here:
www. meteoelvas . com / wxradar.php.
This is the code I am using:
Code:
<script type="text/javascript">
// <![CDATA[
var refreshrate = 60; // seconds between refresh
var image = "RadarIM.php"; // image name
var imgwidth = 600; // image width
var imgheight = 600; // image height
var imgalt = "Radar IM";
function refresh() { document.images["pic"].src = image + "?" + new Date(); setTimeout('refresh()', refreshrate * 1000); } document.write('<img src="' + image + '" alt="' + imgalt + '" name="pic" id="pic" width="' + imgwidth + '" height="' + imgheight + '" style="border: none;" />'); if(document.images)window.onload=refresh; // ]]> </script>
My thanks for possible helps. 
|