Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Closed Points: 50 Time: 15:54 - Jul 11, 2006  

david

Redirect webpage automatically?

How do I redirect the user automatically after a few seconds to another web page?
Is there a meta tag for this, or do I have to use javascript?
What's the best way of doing it?

Answer Discussion
Tutorials

 

rcastagna

Date:: Jul 11, 2006

Time:: 17:45

david,

You can use either Javascript of a meta tag for this...but the meta tag is by-far the easiest to implement.

Here is the structure of the tag:

<meta http-equiv="refresh" content="">

The "work" is going to be done in the "content" of the tag by specifying the delay, and the url where you want the visitor to go. The delay is specified in seconds. The url needs to be the full URL, not just the name of the local file:

<meta http-equiv="refresh" content="5;URL=http://www.yourserver.com/newpage.html&q...

Make sure you check the content - the quotes should be around the entire string, not just the delay or the url, and the semi-colon ";" is required between the delay and url.

If you want to do this with javascript, you'll need to rig up an onload event that is executed after the delay (specified in milliseconds).

function redirect()
{
window.location.href = "http://www.yourdomain.com/newpage.html&q...
}

Next, you'll attach an onLoad event to the <BODY> tag that after the setTimeout value (your delay) has expired, it will execute the redirect function:
<BODY onload="javascript:setTimeout('redirect()', 5000)">

Please let me know if this helps you out...

david

Date:: Jul 11, 2006

Time:: 22:45

great, the metatag works perfect. thanks for the help

Question Answered

This question has been closed, and points have been rewarded to the following experts:


rcastagna: 50

You're welcome however to comment or give additional information or if you wish, you have the ability to write a Tutorial in the Tutorial Area.

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

No tutorials have been submitted yet. Want to be the first?

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10279

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es