javascript asp教程第10課--Apple対象
4779 ワード
Overview:
The Application Object represents a collection of ASP pages.The Apple oject has zero(0)properties,two(2)collection、two(2)methods,andt wo(2)events.
Get Startd:
Below are a couple scripts for lesson 11.
The two collection s are Contents and Static Object.Static Object come in the form of the
The Application Object represents a collection of ASP pages.The Apple oject has zero(0)properties,two(2)collection、two(2)methods,andt wo(2)events.
Get Startd:
Below are a couple scripts for lesson 11.
<%@LANGUAGE="JavaScript"%>
<%
//No ASP Here, just a regular HTML Page
%>
<HTML>
<FORM ACTION="script11a.asp" METHOD="Post">
<STRONG>Would you like to chose the official Application color?</STRONG><BR>
<SELECT NAME="OfficialColor">
<OPTION>red</OPTION>
<OPTION>white</OPTION>
<OPTION>blue</OPTION>
</SELECT><BR>
<INPUT TYPE="Submit" VALUE="Yes, click here">
</FORM>
No, <A HREF="script11a.asp">click here</A>.
</HTML>
Click Here to run script 11 asp in a new window.Below is script 11 a.asp.<%@LANGUAGE="JavaScript"%>
<HTML>
<%
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()
%>
<BODY BGCOLOR="<%=Application("OfficialColor")%>">
<STRONG>
The official application color is <%=Application("OfficialColor")%>.<BR>
</STRONG>
</BODY>
</HTML>
Apple Collection:The two collection s are Contents and Static Object.Static Object come in the form of the