Register  |  Login



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
Answer Summaries

 

Q&A System for Websites and Corporate Collaboration

Advertisement

  • Generates significant organic traffic for websites
  • Saves companies money, resources, and time

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 an Answer Summary for the Summary 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 summaries 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 web development Experts

View More

Rank

Expert

Points

1.

jgivoni

1073

2.

nidhi

890

3.

rcastagna

877

4.

PeterNZ

760

5.

xarcus

620

6.

oracleofDelphi

375

7.

Anpanman

370

8.

theDude

305

9.

redcharcoal

275

10.

rberbe2002

185

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