WEB服务器之一:创建一个网站
2009-01-25 15:04
429 查看
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME=Generator CONTENT=EditPlus>
<META NAME=Author CONTENT=>
<META NAME=Keywords CONTENT=>
<META NAME=Description CONTENT=>
<style type=text/css>
body{font-family:Courier New, Courier}
select{font-size:8pt;font-family:Courier New, Courier}
input{font-size:8pt;font-family:Courier New, Courier}
</style>
<SCRIPT LANGUAGE=JavaScript>
<!--
var Name=new Array(3);
var Value=new Array(3);
Name[1]=new Array(Zosatapo1,Zosatapo2,Zosatapo3,Zosatapo4);
Name[2]=new Array(Reic Yang1,Reic Yang2,Reic Yang3,Reic Yang4);
function change()
{
selIndex=document.all(test).selectedIndex;
if(document.all(test).selectedIndex==0)
return;
for(i=document.all(test).options.length-1;i>-1;i--)
{
document.all(test).options.remove(i);
}
for(i=0;i<Name[selIndex].length;i++)
{
document.all(test).options.add(new Option(Name[selIndex][i],name+i));
}
}
function changeEx(){
for(i=document.all(sub).options.length;i>0;i--)
{
document.all(sub).options.remove(i-1);
}
if(document.all(main).selectedIndex==0){
document.all(sub).options.add(new Option(==========,-1));
return;}
selIndex=document.all(main).selectedIndex;
for(i=0;i<Name[selIndex].length;i++)
{
document.all(sub).options.add(new Option(Name[selIndex][i],name+i));
}
}
function reset(){
for(i=document.all(test).options.length-1;i>-1;i--)
{
document.all(test).options.remove(i);
}
document.all(test).options.add(new Option(==========,-1));
document.all(test).options.add(new Option(Zosatapo,1));
document.all(test).options.add(new Option(Reic Yang,2));
}
function display(object){
alert(object.options[object.selectedIndex].text+ +object.options[object.selectedIndex].value);
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
First Sample:<br><font color=blue>All items will change After you Selected!</font><br>
<SELECT id=test onchange=change();>
<option value=-1 selected>==========
<option value=1>Zosatapo
<option value=2>Reic Yang
</SELECT><input name=Reset Select type=button value=Reset Select onclick=reset(); ><br><br>
Second Sample:<br><font color=blue>You selected Item in Main Select will change the Sub select Content!</font><br>
Main Select:<SELECT id=main onchange=changeEx();>
<option value=-1 selected>==========
<option value=1>Zosatapo
<option value=2>Reic Yang
</SELECT>
Sub Select:<SELECT id=sub onchange=display(this);>
<option value=-1 selected>==========
</SELECT><br><br>
</BODY>
</HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME=Generator CONTENT=EditPlus>
<META NAME=Author CONTENT=>
<META NAME=Keywords CONTENT=>
<META NAME=Description CONTENT=>
<style type=text/css>
body{font-family:Courier New, Courier}
select{font-size:8pt;font-family:Courier New, Courier}
input{font-size:8pt;font-family:Courier New, Courier}
</style>
<SCRIPT LANGUAGE=JavaScript>
<!--
var Name=new Array(3);
var Value=new Array(3);
Name[1]=new Array(Zosatapo1,Zosatapo2,Zosatapo3,Zosatapo4);
Name[2]=new Array(Reic Yang1,Reic Yang2,Reic Yang3,Reic Yang4);
function change()
{
selIndex=document.all(test).selectedIndex;
if(document.all(test).selectedIndex==0)
return;
for(i=document.all(test).options.length-1;i>-1;i--)
{
document.all(test).options.remove(i);
}
for(i=0;i<Name[selIndex].length;i++)
{
document.all(test).options.add(new Option(Name[selIndex][i],name+i));
}
}
function changeEx(){
for(i=document.all(sub).options.length;i>0;i--)
{
document.all(sub).options.remove(i-1);
}
if(document.all(main).selectedIndex==0){
document.all(sub).options.add(new Option(==========,-1));
return;}
selIndex=document.all(main).selectedIndex;
for(i=0;i<Name[selIndex].length;i++)
{
document.all(sub).options.add(new Option(Name[selIndex][i],name+i));
}
}
function reset(){
for(i=document.all(test).options.length-1;i>-1;i--)
{
document.all(test).options.remove(i);
}
document.all(test).options.add(new Option(==========,-1));
document.all(test).options.add(new Option(Zosatapo,1));
document.all(test).options.add(new Option(Reic Yang,2));
}
function display(object){
alert(object.options[object.selectedIndex].text+ +object.options[object.selectedIndex].value);
}
//-->
</SCRIPT>
</HEAD>
<BODY BGCOLOR=#FFFFFF>
First Sample:<br><font color=blue>All items will change After you Selected!</font><br>
<SELECT id=test onchange=change();>
<option value=-1 selected>==========
<option value=1>Zosatapo
<option value=2>Reic Yang
</SELECT><input name=Reset Select type=button value=Reset Select onclick=reset(); ><br><br>
Second Sample:<br><font color=blue>You selected Item in Main Select will change the Sub select Content!</font><br>
Main Select:<SELECT id=main onchange=changeEx();>
<option value=-1 selected>==========
<option value=1>Zosatapo
<option value=2>Reic Yang
</SELECT>
Sub Select:<SELECT id=sub onchange=display(this);>
<option value=-1 selected>==========
</SELECT><br><br>
</BODY>
</HTML>
相关文章推荐
- python web编程 创建一个web服务器
- 一个Web应用(比如网站)是如何部署在多个web服务器上的?同步软件有讲到
- 【重点突破】——使用Express创建一个web服务器
- android手机访问网站时 出现您未被授权查看该页 您试图访问的 Web 服务器上有一个不被允许访问该网站的 IP 地
- 笔试题14:用TCP通信模型创建一个Web服务器(源码)
- 记录一个关于互联网、网页设计、Web开发、服务器运维优化、项目管理、网站运营、网站安全的网站
- 您未被受权查看该页,您试图访问的Web服务器上有一个不被允许访问的网站IP地址列表
- 使用 acl 的生成向导快速创建一个C++ WEB 服务器
- 分享一个学习javaweb服务器的网站 ssm框架
- 无法创建网站“http://localhost:8082/WebSite”。若要在本地 IIS Web 服务器上访问网站,必须以管理员帐户运行 Visual Studio 以便能够访问 IIS 元数据库。也可以安装 FrontPage 服务器扩展(FPSE
- 小翼微信机器人-如何创建自己的微信机器人挂机网站,WEB服务器设置教程
- 使用maven创建一个简单的liftweb网站样例
- 创建一个简单的web服务器
- 一步步学习SPD2010--第十三章节--管理SP Server环境的Web内容(1)--创建一个发布网站
- 如何用nat123创建一个web服务器以达到外网访问内网的目的。
- 一步步学习SPD2010--第十三章节--管理SP Server环境的Web内容(1)--创建一个发布网站
- Windows+Apache+PHP+Mysql 的web服务器 推荐一个好的网站
- 我的Go语言学习之旅八:创建一个简单的WEB服务器
- 在本机环境中搭建一个真正的web网站环境(和网站部署到服务器上效果一致)
- Web设计主题:创建一个古典风格的网站