Below is a table of Response Properties along with examples and explanations.
Allows for the buffering of output CacheControl Response.CacheControl="Public"
Sets Cache to "Public" or "Private" CharSet Response.CharSet="windows-1252"
Sets the ISO character set ContentType Response.ContentType="text/HTML"
Specifies the output mime type (text/html, text/plain, GIF, JPG) Expires Response.Expires=60
Sets page expiration in minutes ExpiresAbsolute Response.ExpiresAbsolute=#January 31, 2003 13:00:00#
Sets time certain for page to expire IsClientConnected if (Response.IsClientConnected==true) { }
Determines if client is still connected PICS ((See Explanation))
Platform for Internet Content Selection Status Response.Status="401 Unauthorized"
Sets Page Status
You are not required to set, alter, or utilize a single Response Property if you don't want to. Having said that, they can be handy once in while. I've demonstrated all but two Properties in the script below.
By the way, set your properties BEFORE you begin output to the client.
Get Started:
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.
Response.Buffer:
Let's take the Properties in order of appearance in our script. Response.Buffer allows us to control the output via Response.Flush() and Response.Clear(). If you haven't 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 Response.Clear(). You might notice that Response.Flush() slows down the server TREMENDOUSLY. Don't use this method without a reason.
Response.CacheControl:
CacheControl 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 your page. (That would be the "Private" setting). The default is "Private."
Response.CharSet:
CharSet allows you to specify the character set, for example: "ISO 8859-1".
Response.ContentType:
ContentType allows you to indicate the mime type of the output. For example there is text/plain and text/html. There is also GIF and JPEG.
Response.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 it in cache, but rather make a separate request to the server before re-displaying the page.
Response.Status:
If tomorrow Congress were to pass a law forbidding the use of Response.Status, I think life would go on. If it makes you happy, use it.
Response.IsClientConnected:
IsClientConnected does exactly what it says. It returns a Boolean value that you can use in an "if" statement.
Response.PICS:
PICS stands for Platform for Internet Content Selection. It allows pages to be rated for the presence of violence, sexuality, language and nudity. There are services on the internet to rate your site. I've never used one. I found a sample PICS string on the internet and I converted to JavaScript.
Response.PICS("(PICS-1.1 <http://www.rsac.org/ratingv01.html> labels on \"1997.01.05T08:15-0500\" until \"1999.12.31T23:59-0000\" 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.
Response.ExpiresAbsolute:
I did not demonstrate ExpiresAbsolute in the script because I already used Response.Expires. ExpiresAbsolute does exactly the same thing as Expires, except it uses a date and time certain. (I couldn't see using both in the same script.) The only thing I would point out is the pound signs (#) at the beginning and and of the date.
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
- 群星《2024好听新歌36》AI调整音效【WAV分轨】
- 梁朝伟.1986-朦胧夜雨裡(华星40经典)【华星】【WAV+CUE】
- 方芳.1996-得意洋洋【中唱】【WAV+CUE】
- 辛欣.2001-放120个心【上海音像】【WAV+CUE】
- 柏菲·万山红《花开原野1》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 柏菲·万山红《花开原野2》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 潘安邦《思念精选集全纪录》5CD[WAV+CUE]
- 杨千嬅《千嬅新唱金牌金曲》金牌娱乐 [WAV+CUE][985M]
- 杨钰莹《依然情深》首版[WAV+CUE][1G]
- 第五街的士高《印度激情版》3CD [WAV+CUE][2.4G]
- 三国志8重制版哪个武将智力高 三国志8重制版智力武将排行一览
- 三国志8重制版哪个武将好 三国志8重制版武将排行一览
- 三国志8重制版武将图像怎么保存 三国志8重制版武将图像设置方法
- 何方.1990-我不是那种人【林杰唱片】【WAV+CUE】
- 张惠妹.1999-妹力新世纪2CD【丰华】【WAV+CUE】