some time to automatically refr...">

If <meta> is deprecated for automatic updates, what should I use?

I used <meta http-equiv="refresh" content="5">some time to automatically refresh my pages, and then found that updating the click before 5 seconds occurred caused automatic updating to fail, at least in IE8.

So, I decided to research the tag <meta>and found, according to Wikipedia: "Auto-update through the META element has been outdated for more than ten years [5] and before that it was recognized as problematic."

So, what SHOULD be used to automatically refresh my pages? (I assume it will be a javy scripty kinda thingy.)

Thanks for the bundles in advance !!!!

+5
source share
5 answers

, javascript.

- :

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

, , .

JQuery/AJAX .

+2

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

<input type="button" value="Reload Page" onClick="window.location.reload()">
+5

- :

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

, 5 .

+1

javascript "", , , , , AJAX .

Depending on the content that is being updated, the β€œnew standard” is to use AJAX behind the scenes to poll / update content and keep browsing history in tact.

+1
source
<body onLoad="setTimeout('window.location = window.location;',5000);">
-3
source

All Articles