javascript asp教程第十一课--Application 对象 Overview: The Application Object represents a collection of ASP pages. The Application object has zero (0) properties, two (2) collections, two (2) methods, and two (2) events. Get Started: Below are a couple scripts for lesson11. <%@LANGUAGE="JavaScript"%> <% //No ASP Here, just a regular HTML Page %>
Click Here to run script11.asp in a new window. Below is script11a.asp. <%@LANGUAGE="JavaScript"%>
<% Application.Lock() var OfficialColor = new String( Request.Form("OfficialColor") ) if (OfficialColor=="red") { Application("OfficialColor") = "red" } if (OfficialColor=="white") { Application("OfficialColor") = "white" } if (OfficialColor=="blue") { Application("OfficialColor") = "blue" } if (OfficialColor=="undefined") { //Do nothing. Just leave the color alone. } Application.Unlock() %> "> The official application color is <%=Application("OfficialColor")%>.
Application Collections: The two collections are Contents and StaticObjects. StaticObjects come in the form of the