|
Response
AddHeader Direction Example
The Response object has a
Response. AddHeader method you can use to send
more generalized header information. i.e. one common use of headers is
to send a message to the browser, informing it that a resource can be
found at a new location. You can specify the length of time the browser
should wait before requesting or redirecting to the new location.
<%Language=VBScript
%>
<% option explicit %>
<%Response.Buffer=true '%>
<%Resopnse.AddHeader "Refresh" ,
"5;URL=tt1a.asp"%>
<html>
<head>
<title>Response AddHeader Redirection Example</title>
<script language="JavaScript">
window.setTimeout("timer()",1000,"JavaScript")
function timer()
{
var s = document.all.item("jumpTime").innerText;
var time = parseInt(s);
time = time - 1;
document.all.item("jumpTime").innerText = time;
if (time > 0)
{
window.setTimeout("timer()",1000,"JavaScript");
}
</script>
<!-
Here's the same script in VBScript
<script language="VBScript">
call window.setTimeout("timer",1000,"VBScript")
Function timer()
dim time
time = document.all("jumpTime").innertext
time = time -1
document.all("jumpTime").innerText = time
If time > 0 Then
call window.setTimeout("timer",1000,"VBScript")
End If
End Function
</script>->
</HEAD>
<BODY>
The resource you have requested has moved. The new location is:
<a href="http://localhost/MasteringASP/tt1a.asp">tt1a.asp</a>.
<p>If your browser supports redirection, it will
jump to the new location in <span id="jumpTime">5</span>
seconds.
</BODY>
</HTML>
|