The Remove method deletes a specific item from the Session object's Contents collection. Contents.Remove( ) Parameters This method has no parameters. Return Values This method has no return values. Parameters Item The name of the member to remove from the collection. Index The index entry for the member to remove from the collection. Example Code The following example adds and removes a variable n
The Abandon method destroys all the objects stored in a Session object and releases their resources. If you do not call the Abandon method explicitly, the server destroys these objects when the session times out. Abandon( ) Parameters This method has no parameters. Return Values This method has no return values. Example Code The following example causes the session state to be released when the se
The IsClientConnected property is a read-only property that indicates if the client has reset the connection to the server. Syntax Response.IsClientConnected ( ) Applies To Response Object Remarks This property enables you greater control over circumstances where the client may have reset the connection to the server. For example, if a long period of time has elapsed between when a client request
The ExpiresAbsolute property specifies the date and time at which a page cached on a browser expires. If the user returns to the same page before that date and time, the cached version is displayed. If a time is not specified, the page expires at midnight of that day. If a date is not specified, the page expires at the given time on the day that the script runs. Syntax Response.ExpiresAbsolute [=[
The Expires property specifies the duration of time before a page that is cached on a browser expires. If the user returns to the same page before it expires, the cached version is displayed. Syntax Response.Expires [**=**number] Parameters number The time, in minutes, before the page expires. Use -1 to specify immediate expiration. IIS returns an error if this number exceeds January 18, 2038 when
The ContentType property specifies the HTTP content type for the response. If no ContentType is specified, the default is text/HTML. Syntax Response.ContentType [**=**ContentType] Parameters ContentType A string describing the content type. This string is usually formatted as type/subtype, where type is the general content category, and subtype is the specific content type. For a full list of supp
For the current response, the Response.CodePage property specifies, how strings are encoded in the intrinsic objects. A code page is a character set that can include numbers, punctuation marks, and other glyphs. Codepages are not the same for each language. Some languages, such as Japanese and Hindi, have multibyte characters, while others, like English and German, only need one byte to represent
The Charset property appends the name of the character set (for example, ISO-8859-13) to the content-type header in the Response object. Syntax Response.Charset(CharsetName) Parameters CharsetName A string that specifies a character set for the page. The character set name is appended to the content-type header in the Response object. Applies To Response Object Remarks This property inserts any st
The CacheControl property enables you to set the HTTP/1.1 Cache Control header in Response.Syntax. The values for CacheControl are strings, and must be enclosed in quotation marks (" "). You must set CacheControl before any response is sent to the client, unless response buffering is enabled. Syntax Response.CacheControl [**=**Cache Control Header] Parameters Cache Control Header The following is
The Buffer property indicates whether to buffer page output. When page output is buffered, the server does not send a response to the client until all of the server scripts on the current page have been processed, or until the Flush or End method is called. The Buffer property cannot be set after the server has sent output to the client. For this reason, the call to Response.Buffer should be the f
The Write method writes a specified string to the current HTTP output. Write( variant ) Parameters variant The data to write. This parameter can be any data type supported by the VBScript VARIANT data type, including characters, strings, and integers. This value cannot contain the character combination %>; instead you should use the escape sequence %\>. The Web server translates the escape s
The Redirect method causes the browser to redirect the client to a different URL. Redirect( URL ) Parameters URL The Uniform Resource Locator (URL) that the browser is redirected to. This can be an full URL beginning with "http://", a virtual path to a location on the same IIS server, or the name of a file contained in the same location as the original URL. URL can include a query string. Older We
The Flush method sends buffered output immediately. This method causes a run-time error if Response.Buffer has not been set to TRUE. Flush( ) Parameters This method has no parameters. Return Values This method has no return values. Applies To Response Object Remarks If the Flush method is called on an ASP page, the server does not honor Keep-Alive requests for that page. Requirements Client: Requi
The End method causes the Web server to stop processing the script and return the current result. The remaining contents of the file are not processed. End( ) Parameters This method has no parameters. Return Values This method has no return values. Applies To Response Object Remarks If Response.Buffer is set to TRUE, calling Response.End flushes the buffer. If you do not want output returned to th
The Clear method erases any buffered HTML output. However, the Clear method erases only the response body; it does not erase response headers. You can use this method to handle error cases. Note that this method causes a run-time error if Response.Buffer has not been set to TRUE. Clear( ) Parameters This method has no parameters. Return Values This method has no return values. Applies To Response
The BinaryWrite method writes the specified information to the current HTTP output without any character conversion. This method is useful for writing nonstring information, such as binary data required by a custom application. BinaryWrite( data ) Parameters data The data to write to the HTTP output. This parameter is of type VT_ARRAY | VT_UI1, which is a variant array of unsigned one-byte charact
The AppendToLog method adds a string to the end of the Web server log entry for the request. You can use it multiple times in one section of script. Each time the method is used, it appends the specified string to the existing entry. AppendToLog( string ) Parameters string The text to append to the log file. Because fields in the log are comma-delimited, this string cannot contain any commas (,).
The AddHeader method adds a new HTML header and value to the response sent to the client. It does not replace an existing header of the same name. After a header has been added, it cannot be removed. PICS was originally designed to help parents and teachers control what children access on the Internet, but it also facilitates other uses for labels, including code signing and privacy. Other rating
You can use the Session object to store information needed for a particular user session. Variables stored in the Session object are not discarded when the user jumps between pages in the application; instead, these variables persist for the entire user session. The Web server automatically creates a Session object when a Web page from the application is requested by a user who does not already ha
The Cookies collection sets the value of a cookie. If the specified cookie does not exist, it is created. If the cookie exists, it takes the new value, and the old value is discarded. Cookies should never be used to store secure data, such as passwords. Cookies are transmitted as clear text. If a malicious user taps an Internet connection, then they can take cookie data to impersonate a client and
The ServerVariables collection retrieves the values of predetermined environment variables and request header information. Server variables obtain most of their information from headers. It is wise to not trust the data that is contained in headers, as this information can be falsified by malicious users. For example, do not rely on data such as cookies to securely identify a user. As a security p
The Cookies collection enables you to retrieve the values of the cookies sent in an HTTP request. Cookies should never be used to store secure data, such as passwords. Cookies are transmitted as clear text. If a malicious user taps an Internet connection, then they can take cookie data to impersonate a client and gain access to their data. If you must transmit sensitive data, do so on a Secure Soc
The QueryString collection retrieves the values of the variables in the HTTP query string. The HTTP query string is specified by the values following the question mark (?). Several different processes can generate a query string. For example, the following anchor tag generates a variable named string with the value "this is a sample." <A HREF="example?string=this is a sample">string sample&l
>The Cookies collection enables you to retrieve the values of the cookies sent in an HTTP request. Cookies should never be used to store secure data, such as passwords. Cookies are transmitted as clear text. If a malicious user taps an Internet connection, then they can take cookie data to impersonate a client and gain access to their data. If you must transmit sensitive data, do so on a Secure So
返回字符串 语法 string.valueOf() 参数 此方法没有参数。 返回值 返回字符串值 备注 在下面的示例中,字符串对象与返回值相同。 var str = "every good boy does fine"; var strStr = str.valueOf(); if (str === strStr) document.write("same"); else document.write("different"); // Output: // same 必备条件 在以下文档模式中受支持:怪异模式、Internet Explorer 6标准模式、Internet Explorer 7标准模式、Internet Explorer 8标准模式、Internet Explorer 9标准模式、Internet Explorer 10标准模式、Internet Explorer 11标
为number的类返回原型的引用。 语法 number.prototype 备注 number参数是数字的名称。 Use the prototype property to provide a base set of functionality to a class of objects. New instances of an object "inherit" the behavior of the prototype assigned to that object. For example, to add a method to the Number object that returns the number of (integer) digits, declare the function, add it to Number.prototype, and then use it.
指定创建一个数字的函数。 语法 number.constructor 备注 必需的number是字符串的名称。 constructor属性是每个具有原型的对象的原型成员。这包括Global和Math对象之外所有内部JavaScript对象。constructor属性包含了对某种函数的引用,此种函数构造了特定对象的实例。 示例 下面的示例阐释了constructor属性的用法。 var num = new Number(); if (num.constructor == Number) document.write("Object is a Number."); else document.write("Object is not a Number."); // Output: // Object is a Number. 必备条件 在以下文档模式中受支持:怪异模式、Internet Exp
返回一个布尔值,指示值是否为整数。 语法 Number.isInteger(numValue) 返回值 如果值是整数则返回true,否则返回false。 备注 必备条件 Microsoft Edge中受支持。应用商店应用(Windows 10 上的 Microsoft Edge)中也受支持。请参阅版本信息。 在以下文档模式中不受支持:怪异模式、Internet Explorer 6 标准模式、Internet Explorer 7 标准模式、Internet Explorer 8 标准模式、Internet Explorer 9 标准模式、Internet Explorer 10 标准模式和 Internet Explorer 11 标准模式。在 Windows 8.1 中不受支持。 Applies To: Number Object 示例 // Returns true Number.i
一个表示任何类型的数字对象。所有JavaScript数字均为64位浮点数。 语法 numObj = new Number(value) 参数 numObj 必要参数。Number对象分析到的变量名称。 value 必要参数。数值。 备注 变量设置为数值(例如var num = 255.336;)时,JavaScript创建Number对象。很少需要显式创建Number对象。 除了从Object继承的属性和方法,Number对象自然还具有属性和方法。在某些情况下,数字将转换为字符串,例如在向字符串添加或串联数字时,以及在使用toString方法执行这些操作时。欲进一步了解,请参阅加法运算符 (+)。 JavaScript具有多个数字常量。欲获取完整列表,请参阅Number 常量。 必备条件 在以下文档模式中受支持:怪异模式、Internet Explorer 6标准模式、Internet E
返回指定对象的原始值。 语法 mapObj.valueOf() 参数 mapObj 必要参数。Map对象。 属性值、返回值 返回Map实例。 必备条件 在Internet Explorer 11标准文档模式下支持此项。此外,也在应用商店应用(Windows 8.1和Windows Phone 8.1)中受支持。请参阅版本信息。 在以下文档模式中不受支持:怪异模式、Internet Explorer 6标准模式、Internet Explorer 7标准模式、Internet Explorer 8标准模式、Internet Explorer 9标准模式和Internet Explorer 10标准模式。在Windows 8中不受支持。
返回映射的字符串表达形式。 语法 mapObj.toString() 参数 mapObj 必要参数。Map对象。 属性值、返回值 映射的字符串表示形式。 异常 必备条件 在Internet Explorer 11标准文档模式下支持此项。此外,也在应用商店应用(Windows 8.1和Windows Phone 8.1)中受支持。请参阅版本信息。 在以下文档模式中不受支持:怪异模式、Internet Explorer 6标准模式、Internet Explorer 7标准模式、Internet Explorer 8标准模式、Internet Explorer 9标准模式和Internet Explorer 10标准模式。在Windows 8中不受支持。