Click to See Complete Forum and Search --> : Instant Redirect?
St. Nick
05-11-2003, 09:15 AM
Hi, I am trying to make a website that instantly (or almost) redirects the user to my site, preferably without seeing the redirect page itself. I have looked all over for a code, but they all take a long time and when I try to shorten the time myself, it just messes up.
Thanks in advance!
Once I get this working again, my website is:
www.clik.to/playonline
*****************************
Thank you very much! It works perfectly now!
:)
doodler
05-11-2003, 09:26 AM
there are many ways to do this without javascript eg using a meta refresh.
But seeing as this is a javascript forum heres the script:
<script language="javascript">
var page = "index.html" //the page to redirect to
top.location = page;
</script>
David Harrison
05-11-2003, 03:08 PM
<html>
<head>
<script language="javascript">
window.location="http://www.geocities.com/prejudiced_against_everyone/";
</script>
</head>
<body>
</body>
</html>
AdamGundry
05-11-2003, 04:20 PM
You should use Dave's meta refresh code, because it will work in browsers without Javascript.
Also, include a link to the page in case meta refresh is disabled.
Adam
lmccord2
05-11-2003, 04:21 PM
It is quite simple...
<body onload="window.location.replace('your-page.html')">
NOTE: The italizised text is what you replace with what to redirect to.
Thanks,
Josh
Charles
05-25-2003, 04:45 AM
Originally posted by lmccord2
It is quite simple...
<body onload="window.location.replace('your-page.html')">
NOTE: The italizised text is what you replace with what to redirect to.
Thanks,
Josh But that will replace the page only after it has been loaded, St. Nick doesn't want the initial page to flash. The two methods mentioned above will do just fine, though. And one should note that there is another method that will work even more often than those. Play with your server and get it to send a redirect header as your HTTP response.