Web Hosting Offers
See the new scripts recently added to Dynamic Drive. Click here.
Original, practical CSS codes and examples such as CSS menus for your site.
javascript tutorial Browse Basic JavaScript Tutorial
Browse JavaScript Script resources
Browse javascript FAQS
Categories:

javascript tutorial
buy template
Home >> Tutorials >> Advanced javascript tutorials

Page Forwarding:

META for Automatic Page Forwarding

You can use <META ...> to tell the web browser to automatically move to another web page after a specified period of time..This will be very useful when you move your website to a new address. To transfer a visitor to a new URL/address, place the following line between the HEAD tags :

<META HTTP-EQUIV="refresh" CONTENT="5;URL=http://www.newurl.com">

Here we gives two pieces of information: CONTENT=5 means your browser waits for 5 seconds to reload and forward to  the new URL.

Automatic Page forwarding using Javascript

You can use a Javascript function to achieve the same task (without using the META TAG given above):

 function TransferToURL(){
window.location.href="http://www.newurl.com"

}

which is called by an onLoad in the BODY tag:

<BODY onLoad="setTimeout('TransferToURL()',5000)">.
Top



 

Page contents: itechies.net - Learn how to tell the web browser to automatically move to another web page using Html.
javascript tutorial
javascript book
Buy this book