I try to steer clear of modifying a page without the user triggering the change, much less automatically refresh or redirect a page. There are times when automatically refreshing the page is important, like when you pull up game play-by-play pages on NFL.com or ESPN.com. Whatever your reason for automatically refreshing the page, keep one thing in mind: auto-refresh only pages that have little interaction -- nothing more than a click.
var timer = null;
window.location = 'http://domain.com/page.php';
<body onload="timer = setTimeout('auto_reload()',10000);">
The META Tag Method
The following refreshes the page every 30 seconds.
<meta http-equiv="refresh" content="30" />
San Francisco, CA · January 20-22
Get 20% off with
attachEvent. Times have changed but there are still a few functions each developer should...
I'd bet one of the most used MooTools methods is the
setStyle() method, which allows you to set CSS style declarations for an element. One of the limitations of MooTools'
setStyle() method is that it sets the specific style for all medias.