Click to See Complete Forum and Search --> : Redirection In Javascript
PsyVision
Oct 9th, 2000, 03:15 PM
Is it possible to make it so when a page loads on the net it redirects to another page in java script, if so how ?
If this cannot be done then how do i open a new window at a certain address ?
Ianpbaker
Oct 10th, 2000, 06:21 AM
hi PsyVision
you need to use the window.location function
<HTML>
<script language="javascript">
function redirectbrowser()
{
window.location = "somepage or url"
}
</SCRIPT>
<BODY onload="redirectbrowser();">
</BODY>
</HTML>
Hope this helps
Ian
oetje
Oct 10th, 2000, 08:50 AM
You don't need javascript for that, you can use this:
<HTML>
<HEAD><TITLE>Redirecting</title>
<meta http-equiv="Refresh" content="1; URL=http://www.altavista.com">
</HEAD>
</HTML>
PsyVision
Oct 10th, 2000, 02:16 PM
But...
A short while after writing this post i scripted my own at last. I tried the second way but it never opened the new page i wanted, just refreahed the browser. What i did is bascially the same as 'Ianpbaker' did it.
Thanks Again.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.