Redirect to another page means to open another page (the other url) immediately or within a certain time when opening a webpage. We can do it either with HTML codes only or using Javascript. Redirect is usually used when your web site or specific pages has been moved to another page or website. Therefore, by using redirect the visitor when opening page will be instantly moved to the intended page. The trick as follows:
First Way
Use the following codes, can be placed between <HEAD> and </HEAD> tag in your HTML code.
<META HTTP-EQUIV="REFRESH"
|
HTML codes above will redirect to another page immediately. The code CONTENT="0; above states time interval (in seconds) prior to perform redirect. While URL points to address of the web page will be opened (redirect). Change the URL with your target URL.
Second Way
Another way to redirect is by using Javascript. The code below is placed inside the tags <BODY. It will be like this:
<BODY ONLOAD="Javascript:window.location.href=' |
Just change the URL with your target URL.
Or you can also use the following codes, they can be placed anywhere within your HTML code.
<script language="javascript"> window.location.href=" |
2 comments:
I like this tutorial. this really help me.
Good tutorial. It would be even more useful if you would explain the code as well.
Post a Comment