some usefull HTML for your website

Started by G0HWC, January 26, 2010, 11:07:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

G0HWC

Hi all,
my page that displays my image uploaded from my AirNav had a refresh
of 60 secs  http://g0hwc.com/airnav.html
This was fine but it was refreshing the whole page and I just wanted
to update the RadarBoxScreenShot.gif image.
I am now using this script.

<img src="airnav/RadarBoxScreenShot.gif" width="960" height="844" border="1" name="refresh">
 <script language="JavaScript" type="text/javascript">
     <!--
     var t = 30 // interval in seconds
     image = "airnav/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>

Now only the image is refreshed and not the whole page.
May be handy to some of you.

Paul
My AirNav Live HERE:
http://www.g0hwc.com/airnav.html

Want to join the "Aiir Navigation Webring" ?
Infomation HERE
http://www.g0hwc.com/airnav_webring.html

Join me as I drive around UK in my truck with Live images
http://www.truckcam.tv

RodBearden

Paul - many thanks for this script - it works a treat.

Rod
Rod

abrad41

Paul - Cannot get your links to open.

Andy

peteeds

Abrad 41,  Paul's site is closed down for the next few hours, he is carrying out some maor upgrades & site maintennance works, knowing Paul he will get back to you as soon as he is up & running again.
Hope this helps.
Cheers de Peter 2W1FJZ


G0HWC

My AirNav Live HERE:
http://www.g0hwc.com/airnav.html

Want to join the "Aiir Navigation Webring" ?
Infomation HERE
http://www.g0hwc.com/airnav_webring.html

Join me as I drive around UK in my truck with Live images
http://www.truckcam.tv

RodBearden

As a non-programmer, I have a request for those of you who understand these things.

Now that I've incorporated the code to refresh the RadarBox screenshot image on my webpage, could somebody whip up some code to display one picture when I'm online, and another picture when the image is, for example, more than two minutes old?

That way I could show the screenshot when I'm online, but a "Currently offline" image when I'm not.

It sounds quite an easy job to me, but, as I say, I know nothing :-)

Rod
Rod

Bell 407

Hey G0HWC,

Thanks for this brilliant piece of coding - probably the best little snippet of code I have used in a while.

Makes the update of images so much better than refreshing the whole page.

Thank you.

Cheers,

G0HWC

Quote from: Bell 407 on April 07, 2010, 02:02:39 PM
Hey G0HWC,

Thanks for this brilliant piece of coding - probably the best little snippet of code I have used in a while.

Makes the update of images so much better than refreshing the whole page.

Thank you.

Cheers,

Im glad its of some use to you

Paul
My AirNav Live HERE:
http://www.g0hwc.com/airnav.html

Want to join the "Aiir Navigation Webring" ?
Infomation HERE
http://www.g0hwc.com/airnav_webring.html

Join me as I drive around UK in my truck with Live images
http://www.truckcam.tv

RodBearden

Paul - I'm using it too - many thanks for it.

Has anyone got a solution to the question I asked in reply #6?

Rod
Rod

G0HWC

#10
Quote from: RodBearden on April 09, 2010, 09:33:49 PM
Paul - I'm using it too - many thanks for it.

Has anyone got a solution to the question I asked in reply #6?

Rod

Hi Rod,
I dont know a easy way to do this, On my Truckcam site
When I finish work for the day and no more images of the view
from my truck will be uploaded I just use a simple FTP program
to send a "Truckcam" off line image. This is easy as I only need
to do this at the end of every working day..

Paul
My AirNav Live HERE:
http://www.g0hwc.com/airnav.html

Want to join the "Aiir Navigation Webring" ?
Infomation HERE
http://www.g0hwc.com/airnav_webring.html

Join me as I drive around UK in my truck with Live images
http://www.truckcam.tv