Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 19th, 2004, 04:17 AM
Registered User
 
Join Date: Aug 2004
Location: , , Netherlands.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default From today's links to other htmlpages after define


Hello,
I am trying to master (?) JavaScript and I am a little bit in trouble now.
On the "index.html" are a lot of links, each one leading to another html.page.
How can I change (or redirect) to another html.page after a well defined period of time (ex. 5 or 12 days from now on).
So people go automatically to another htmlpage (to see different content) from that specific date.


I tried with the expression <body onLoad="fctionChange">.
Trying to write this "fctionChange" I don't know how to handle the date of today and the date in the future.
I guess it has something to do with " if .... else", but I'ts a hard time to make it work.
Maybe I am wrong and it has nothing to do with the "onLoad"event.

Can anyone of you please help me or give me some helpfull tips.
Thanks a lot.

I posted this thread already, but maybe I was not clear enough.
So this is a new try to set things straight.
Sorry .. and thanks for trying to help me.

jef



Reply With Quote
  #2 (permalink)  
Old August 19th, 2004, 01:13 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

To redirect to another page after x many seconds:
Code:
var delay = 5; //set delay to the amount of seconds before redirecting

var newpage = "http://www.google.com/"; //set newpage to the page to redirect to

delay = delay * 1000;

setTimeout("window.location.replace(newpage)",delay);
Hope this helps

Snib

<><
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display today's date in a Dropdownlist dcct84 C# 2 October 5th, 2007 09:20 AM
How to define .tld wesleygch JSP Basics 1 April 10th, 2007 07:54 AM
Can u define difference ? gvcc_neel .NET Framework 2.0 4 October 10th, 2005 04:56 AM
Please Define SDK eberly General .NET 2 April 10th, 2005 04:49 PM
Database define Controls everthalia ASP.NET 1.0 and 1.1 Basics 0 July 26th, 2004 08:01 AM



All times are GMT -4. The time now is 03:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.