javascript asp教程の第7課--reponse属性
5024 ワード
Below is a table of Resonse Properties along with examples and explantions.
Resonse Propties
Buffer
Resonse.Buffer=true Allows for the buffering of out put
CacheControl
Reponse.C.acheControl=「Public」Sets Cache to「Public」or「Private」
CharSet
Resonse.China Set=「windows-152」Sets the ISO character set
ContentType
Respecifes the output mime type(text/playe、GIF、JPG)
エクスプレス
Resonse.Expires=60 Sets page expiration in minutes
Expires Absolute
Resuponse.Expires Absoute=菗Januar 31,2003年13:00攂Sets time certain for page to expire
IsClient Conneced
if(Resonse.Is Cient Connected==true){}Determines if client is still connected
PICS
(((See Explannation)Platform for Internet Contect Selection
Status
Resonse.Sttus=“401 Uauthorized”Sets Page Sttus
You are not required to set,alter,or utilize a single Resonse Property if You don't want to.Having said that,they can be handy onece in while.I've demont strand albut wo Propties in the script below.
By the way、set your properties BEFOREE you begin out put to the client.
Get Startd:
Below is the ASP script for Lesson 07.
Resonse.Buffer:
Let's Tane the Properties in order of apparance in our script.Resonse.Buffer allows us to control the out put via Resonse.Fush()and Resonse.Clear().If you haven'already,click onto the link to run the script.You'll get a strange output with some of the numbers missing.The missing numbers are thanks to Resonse.com.You might notice ththat Response.Flash.flash。
Resonse.C.acheControl:
Cacheco Control gives you the power to authorize proxy servers to keep your page in cache.(That would be the"Public"setting.)Likewise,it allows you to disallow proxy servers from caching Joure the page."
Resonse.China Set:
CharSet allows you to specify the character set,for example:ISO 8859-1.
Resonse.ContintentType:
ContentType allows you to indicate the mime type of the output.For example there is text/plin and text/html.The is also GIF and JPEG.
Resonse.Expires:
Expires allows you set an expiration time for the page.By setting the Expires property to-1,you are saying the page expired one minute before it was delivered.The browser will(hopefully)not store the cachee the
Resonse.Sttus:
If tomorrow Congress were to pass a law forbidding the use of Resonse.Stuts,I think life would gon.If it makes you happy,use it.
Resonse.Is Cient Conneced:
Is Client Conneced does exactly what it says.It returns a Boolean value that you can use in'if'statement.
Resonse.PICS:
PICS stands for Platform for Internet Contint Selection.It allows pages to be rated for the presence of violence,sexuality.The e e are services on the internet to rate your site.I'never.inver.infone.stred.com。
Resonse.PICS("(PICS-1.1<labels on\"97.01.05 T 08:15-500\"until\"199.12.31 T 23:59-000\"ratings(v 0 s 0 l 0 n 0)")
It's a long string and your browser may have wrapped the text down to a second line.If that's the case,then you have to pretend that the entire PICS string is on one line.
Resonse.Expires Absolute:
I did not demontststort Expiress Absoliute in the script because I already used Reponse.Expiree.Expires.Expires.Expires.Expires.Expires.Expists.Expires.Expistininine.Expititime.Expiststine.Expires.Expistinininininininininininininininine.Expiststststststststststs.eeeeeeininininininininininininininininininininininininininininininininininininininininininininininininthe beginning and and of the date.
Resonse Propties
Buffer
Resonse.Buffer=true Allows for the buffering of out put
CacheControl
Reponse.C.acheControl=「Public」Sets Cache to「Public」or「Private」
CharSet
Resonse.China Set=「windows-152」Sets the ISO character set
ContentType
Respecifes the output mime type(text/playe、GIF、JPG)
エクスプレス
Resonse.Expires=60 Sets page expiration in minutes
Expires Absolute
Resuponse.Expires Absoute=菗Januar 31,2003年13:00攂Sets time certain for page to expire
IsClient Conneced
if(Resonse.Is Cient Connected==true){}Determines if client is still connected
PICS
(((See Explannation)Platform for Internet Contect Selection
Status
Resonse.Sttus=“401 Uauthorized”Sets Page Sttus
You are not required to set,alter,or utilize a single Resonse Property if You don't want to.Having said that,they can be handy onece in while.I've demont strand albut wo Propties in the script below.
By the way、set your properties BEFOREE you begin out put to the client.
Get Startd:
Below is the ASP script for Lesson 07.
<%@LANGUAGE="JavaScript"%>
<%
Response.Buffer=true
Response.CacheControl="Private"
Response.CharSet="windows-1252"
Response.ContentType="text/HTML"
Response.Expires=-1
Response.Status="200 OK"
%>
<HTML>
<BODY>
<%
if (Response.IsClientConnected==true)
{
Response.Write("The client is connected.<BR>")
}
else
{
Response.End()
}
%>
<TABLE BORDER="2">
<TR>
<%
for (x=1;x<=200;x++)
{
Response.Write("<TD>" + x + " </TD>\r")
if (x%10==0)
{
Response.Clear()
}
if (x%4==0)
{
Response.Write("</TR></TABLE>\r")
Response.Write("<TABLE BORDER=\"2\">")
Response.Write("\r<TR>")
Response.Flush()
}
}
%>
</TR></TABLE>
</BODY>
</HTML>
Click Here to run the script in a new window.After you click onto the link,really study the numbers.See if you notice anything weird about the page,like missing numbers.Resonse.Buffer:
Let's Tane the Properties in order of apparance in our script.Resonse.Buffer allows us to control the out put via Resonse.Fush()and Resonse.Clear().If you haven'already,click onto the link to run the script.You'll get a strange output with some of the numbers missing.The missing numbers are thanks to Resonse.com.You might notice ththat Response.Flash.flash。
Resonse.C.acheControl:
Cacheco Control gives you the power to authorize proxy servers to keep your page in cache.(That would be the"Public"setting.)Likewise,it allows you to disallow proxy servers from caching Joure the page."
Resonse.China Set:
CharSet allows you to specify the character set,for example:ISO 8859-1.
Resonse.ContintentType:
ContentType allows you to indicate the mime type of the output.For example there is text/plin and text/html.The is also GIF and JPEG.
Resonse.Expires:
Expires allows you set an expiration time for the page.By setting the Expires property to-1,you are saying the page expired one minute before it was delivered.The browser will(hopefully)not store the cachee the
Resonse.Sttus:
If tomorrow Congress were to pass a law forbidding the use of Resonse.Stuts,I think life would gon.If it makes you happy,use it.
Resonse.Is Cient Conneced:
Is Client Conneced does exactly what it says.It returns a Boolean value that you can use in'if'statement.
Resonse.PICS:
PICS stands for Platform for Internet Contint Selection.It allows pages to be rated for the presence of violence,sexuality.The e e are services on the internet to rate your site.I'never.inver.infone.stred.com。
Resonse.PICS("(PICS-1.1<
It's a long string and your browser may have wrapped the text down to a second line.If that's the case,then you have to pretend that the entire PICS string is on one line.
Resonse.Expires Absolute:
I did not demontststort Expiress Absoliute in the script because I already used Reponse.Expiree.Expires.Expires.Expires.Expires.Expires.Expists.Expires.Expistininine.Expititime.Expiststine.Expires.Expistinininininininininininininininine.Expiststststststststststs.eeeeeeininininininininininininininininininininininininininininininininininininininininininininininininthe beginning and and of the date.