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" />
Sooner or later you'll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In...
-webkit-touch-callout CSS property, which prevents iOS's link dialog menu when you tap and hold a clickable element. The
click actions from doing...