Automatically Refresh a Page Using JavaScript or Meta Tags
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.
The JavaScript Method
var timer = null;
function auto_reload()
{
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.
<head>
<meta http-equiv="refresh" content="30" />
</head>
Before we get started, it's worth me spending a brief moment introducing myself to you. My name is Mark (or @integralist if Twitter happens to be your communication tool of choice) and I currently work for BBC News in London England as a principal engineer/tech...
When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It." Can you blame us though? We watched the fundamental APIs stagnate for so long that a basic feature...
Speech recognition software is becoming more and more important; it started (for me) with Siri on iOS, then Amazon's Echo, then my new Apple TV, and so on. Speech recognition is so useful for not just us tech superstars but for people who either want to work "hands...
A while back David Walsh published a list of
7 MooTools Plugins You Should Use on Every Website
which included 'AutoGrow' a text area expander plugin. 'AutoGrow' is very similar in results to the class I wrote for Education.com, Flext. I decided to release this...
I use a refresh feature in Firefox 3.0 (it’s an add-in) that allows me to set a refresh time for a page from 30 secs to unlimited minutes. I was wondering if you know of a program or add-in for IE7 (and now IE8) that would allow me to do same kind of thing.
Thanks
WldHogn
hi i am trying to reset counter after time interval and restart automatically. your code runs properly but it will post back if i want to avoid postback then what to do…
thanku
hi…..
In my project the cascading style sheet is not working properly. So i thought of onload page refresh . So, can u please help me out with some code or any other stuff that gonna work properly please……….
thank you…
wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww
Wow. Simple and works fine.
Thanks a lot
Nice and gud ……… ur code is working ……
thanksssssss
Could this script to change alexa rank ?
How to reload page only one time on timer using jquery
Would this work to have the browser return to the home page? I need something that will time out and reset the broser back to homepage after a search or other actions on the system