PDA

Click to See Complete Forum and Search --> : redirection


buster
Feb 20th, 2002, 10:41 AM
Hi all,

Is there a Javascript command that does the same has

<code>response.redirect ("URL")</code>

Note:response.redirect ("URL") is in VBScript

Thanks

filburt1
Feb 20th, 2002, 01:09 PM
window.location = ...;

PHP:
header("Location: whereever.html");
If the page's only purpose is to redirect, then you can use a META tag with a REFRESH attribute. I think it goes something like:

<head>
.
.
.
<meta http-equiv="refresh; 0" content="whatever.html">
.
.
.
</head>

scoutt
Feb 20th, 2002, 05:41 PM
close Arien


<META HTTP-EQUIV="Refresh" Content="5;URL=page.html">

also that header("Location: whereever.html"); can also impliment a bunch of wrning messages that say header already sent if the person doesn't do it right.

but wouldn't javascript be

<head>
<SCRIPT LANGUAGE="JavaScript">
function redirectPage() {
window.location.href= youpage.html;
}
</script>
</head>
<body onload="redirectPage()">

filburt1
Feb 27th, 2002, 04:08 PM
Why onClick? :confused: Shouldn't it be onLoad?

scoutt
Feb 27th, 2002, 04:22 PM
yes you are right. not sure how that got there.