Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

if <meta> is deprecated for auto refreshing, what should i use?

Tags:

html

I've been using <meta http-equiv="refresh" content="5"> for a little while to auto update my pages, and then I found that clicking refresh before the 5 seconds is up causes the auto update not to work, at least in IE8.

So I decided to research the <meta> tag and found, according to wikipedia: " Auto refreshing via a META element has been deprecated for more than ten years [5] and recognized as problematic before that ".

So, what SHOULD I be using to auto update my pages? (I am guessing it will be a javy scripty kinda thingy.)

Thanks bunches in advance!!!!

like image 805
John Fitzpatrick Avatar asked Jul 19 '11 17:07

John Fitzpatrick


2 Answers

use

<script>
 setTimeout("window.location.reload(true);",5000);
</script>

or

<input type="button" value="Reload Page" onClick="window.location.reload()">
like image 120
TheSystem Avatar answered Sep 28 '22 23:09

TheSystem


Yeah, you can do it easily with javascript.

Something like that:

function timedRefresh(timeoutPeriod) {
setTimeout("location.reload(true);",timeoutPeriod);
}

I don't know what you really want to do, but refreshing the entire page might be overkill.

Consider using JQuery/AJAX to refresh only a part of your page.

like image 20
Cygnusx1 Avatar answered Sep 28 '22 23:09

Cygnusx1