Click to See Complete Forum and Search --> : Link to other page after x seconds
Gary@DoMaths
12-20-2003, 06:58 PM
I am new to this forum and i have recently got a new web site, and i am wondering on what is the best code for letting my title page display x seconds and then automatically directing users to my main page.
If anyone can help with this i would be very thankful:D
simpson97
12-20-2003, 08:34 PM
This should help:
It is set to goto new page in 5 seconds.
<META HTTP-EQUIV="Refresh" CONTENT="5;URL=new_page.html">
rhsunderground
12-20-2003, 10:46 PM
here is what i was told when i asked this very question.
Originally posted by Pittimann
Hi!
You can try something like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script type="text/javascript">
<!--
var waitHowLong=5;//put your seconds to wait here
function openLinkDelayed(){
delay=window.setTimeout("location.href='mypage.htm'", waitHowLong*1000);
}
//-->
</script>
</head>
<body>
<a href="#" onclick="openLinkDelayed()" title=" Goto mypage.htm ">click</a>
</body>
</html>
Cheers - Pit
AdamBrill
12-21-2003, 09:05 PM
You would be much better off to use what simpson97 recommended rather than what rhsunderground did since simpson97's doesn't use JS... Also, just in case you don't know, the meta tag should go in the head of the document.