Login or Sign Up
Logging in...
Remember me
Log in
Forgot password or user name?
or
Sign Up
Log in with
Search in titles only
Search in JavaScript programming only
Search
Advanced Search
Forum
Groups
Today’s Posts
Calendar
Forum
Client side development
JavaScript programming
Announcement
Collapse
No announcement yet.
redirect in 5 seconds
Collapse
X
Collapse
Posts
Latest Activity
Photos
Search
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
alaios
New to the CF scene
Join Date:
Aug 2002
Posts:
456
Share
Tweet
#1
redirect in 5 seconds
Feb 22, 2004, 11:38 PM
Hi there i want to redirect my users using Javascript. The script i want to redirect to another page after 5 seconds. I want the code to be as small as possible. the best it would be if it was one line..........
Thx
Kor
New to the CF scene
Join Date:
Apr 2003
Posts:
8818
Share
Tweet
#2
Feb 23, 2004, 04:09 AM
Is it to be javascript by all means?
...'cose you have the smallest possible pure HTML solution. In head add:
<meta http-equiv="refresh" content="5; Url=
new url
">
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Comment
Post
Cancel
Kor
New to the CF scene
Join Date:
Apr 2003
Posts:
8818
Share
Tweet
#3
Feb 23, 2004, 04:35 AM
Anyway, You can try this:
<script>
function r(a){
if(a==undefined ){setTimeout('r(0)',5000)}
else{window.location='new_url'}
}
window.onload = r;
</script>
You may choose which other event you want instead of window.onload
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
X
Comment