SQL PHP HTML ASP JavaScript articles and free scripts to download

Page refresh and redirect through meta tags

We can refresh a page at a particular interval by using Meta refresh tags within the head area of a page. User doesn't have any control over the refresh rate of the page. This is usually used where page content changes over time. A page showing the cricket score has to refresh itself to display the current score. So at a particular interval the page reloads by meta refresh tag and collects the fresh score from the server. Here is the basic command used to refresh a page.

<meta http-equiv="Refresh" content="15">
Here the page will refresh after every 15 seconds.

Redirecting using meta refresh tags

We can use the same technique of refresh to redirect the page to a new location or a URL. Here by changing the time we can control the duration for which the current page will stay or load before the redirection takes place to new URL. Here is the code.
<meta http-equiv="Refresh" content="15;URL=http://www.google.com">
Here the page will redirect to google.com after loading for 15 seconds.

This type of meta redirection is different than header redirection. In a header redirection browser does not load the source page so it has no effect on header information the browser already have.

Page refresh by using button

In addition to automatic refresh by meta tag, we can give a button which can be used by visitors to refresh the page before the meta refresh takes effect.
<input type=button onClick="location.href='refresh.php'" value='click here to refresh this page'>:

Please rate this Article on one to five scale

Google+
Post Comment This is for short comments only. Use the forum for more discussions.
Name
Email( not to be displayed)Privacy Policy
1+2=This is to prevent automatic submission by spammers. Please enter the result of the sum as asked



Join Our Email List
Email:  
For Email Newsletters you can trust
HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us

©2000-2014 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer