I will create a jQuery slide show, but you need to refresh the page every 5 minutes to change the content.
I know that I can do this with Javascript, but this can be changed on the client side to avoid page refresh. Is there a way for the server to drag out the page and force refresh?
In addition to reloading javascript, you can send the update header:
header("Refresh: 300;url='http://thepage.com/example'");
The browser will be redirected after 300 seconds regardless of javascript. However, it can be disabled in the browser configuration, but it usually does not turn off.
Updating the meta will work very simply:
<meta http-equiv="refresh" content="300">
300 , 300 5 . , JavaScript, .
.
JavaScript :
setTimeout(function() { window.location.reload(); }, 5000);
, reguler script.
: - , ?
META Tag
The following refreshes the page every 30 seconds. <head> <meta http-equiv="refresh" content="30" /> </head>
php-, url
// write the function function refresh( $time ){ $current_url = $_SERVER[ 'REQUEST_URI' ]; return header( "Refresh: " . $time . "; URL=$current_url" ); } // call the function in the appropriate place refresh( 4 ); // this refreshes page after 4 seconds
JavaScript
var timer = null; function auto_reload() { window.location = 'http://domain.com/page.php'; } <body onload="timer = setTimeout('auto_reload()',10000);">
- window.location:
window.location
setTimeout(function(){ window.location.href = "YOUR_PAGE_URL"; }, 5000);