Author Topic: How to Make my webpages to Refresh every 20 seconds  (Read 2013 times)

0 Members and 1 Guest are viewing this topic.

Offline Davidb

  • Contributor
  • ***
  • Posts: 129
    • Glasson Sailing Club
How to Make my webpages to Refresh every 20 seconds
« on: September 05, 2022, 01:52:12 PM »
.
As per the title, I have an image of our estuary on our web page and a script at the bottom which shows Upload/download internet speeds, but I have to go into browser settings to delete cached images which is highly unsatisfactory.

Before we used wordpress, there was a line in the page HTML which said something like "refresh content=20" or similar.

Does anyone know how to acheive this, please?
.
http://glassonsailing.co.uk/wp/weather/
.
« Last Edit: September 05, 2022, 02:29:56 PM by Davidb »

Offline chief-david

  • Educational Weather
  • Forecaster
  • *****
  • Posts: 2845
  • Space Academy for Educators
    • Benilde-St. Margaret's Weather
Re: How to Make my webpages to Refresh every 20 seconds
« Reply #1 on: September 05, 2022, 05:35:58 PM »
<meta http-equiv="refresh" content="3600">

content is the time in seconds


put it in the header



You can't phase me-I teach Middle School.
It's not you-It's WU.

Offline Davidb

  • Contributor
  • ***
  • Posts: 129
    • Glasson Sailing Club
Re: How to Make my webpages to Refresh every 20 seconds
« Reply #2 on: September 06, 2022, 03:46:01 AM »
Thanks for that, it is what I used to use on the old pages. Now I need to try and get that into the html of my Wordress page, which seems far more complicated than the old pages were. Below is a clip of part of the first few lines of the Page's html:
.
.
 [ You are not allowed to view attachments ]
« Last Edit: September 06, 2022, 12:01:34 PM by Davidb »

Offline Jiveborn

  • Jan
  • Member
  • *
  • Posts: 27
    • Jiveborn
Re: How to Make my webpages to Refresh every 20 seconds
« Reply #3 on: September 06, 2022, 06:17:49 AM »
Hi!

You can try this, it works on my website:

<head>
<script type="text/javascript">
<!-- Begin 

/* This script and many more are available free online at
The JavaScript Source!! http://javascript.internet.com
Created by: Lee Underwood

Because this is a true refresh, you might want to put a
notice on the page that it refreshes every "X" minutes */

function reFresh() {
  location.reload(true)
}
/* Set the number below to the amount of delay, in milliseconds,
you want between page reloads: 1 minute = 60000 milliseconds. */
window.setInterval("reFresh()",60000);
// End -->
</script>
 
<meta http-equiv="Refresh" content="60" />

</head>

Offline Davidb

  • Contributor
  • ***
  • Posts: 129
    • Glasson Sailing Club
Re: How to Make my webpages to Refresh every 20 seconds
« Reply #4 on: September 06, 2022, 12:31:19 PM »
.
"You can try this, it works on my website:

<head>"

Thanks for that, Jiveborn, I have tried to find my webpage by name via Filezilla file manager, but have drawn a blank so far. Wordpress works in mysterious ways! Perhaps I need to enquire on a wordpress forum?

However, I have inserted the code into the html for the two blocks in this trial web page and set it at 20secs for testing. It updates with a flash, but might serve its purose if I set it to 1 minute on the actual weather page?

http://glassonsailing.co.uk/wp/test-refresh/