几个JS的实例
来源:互联网 发布:杀破狼js高品质百度云 编辑:程序博客网 时间:2024/04/29 15:29
<a target=_top href="javascript:window.external.addFavorite('http://www.webjx.com','网页教学网');">加入收藏</a>
<a href='http://www.webjx.com/htmldata/2005-12-04/1133660241.html#' onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.webjx.com');">设为首页</a>
<script language="JavaScript">...
function GetResult(str)
...{
/**//*
*--------------- GetResult(str) -----------------
* GetResult(str)
* 功能:通过XMLHTTP发送请求,返回结果.
* 参数:str,字符串,发送条件.
* 实例:GetResult(document.all.userid.value);
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-27 19:02
*--------------- GetResult(str) -----------------
*/
var oBao = new ActiveXObject("Microsoft.XMLHTTP");
oBao.open("POST","http://192.168.1.199/Server.do?sel="+str,false);
oBao.send();
//服务器端处理返回的是经过escape编码的字符串.
//通过XMLHTTP返回数据,开始构建Select.
BuildSel(unescape(oBao.responseText),document.all.sel2)
}
function BuildSel(str,sel)
...{
/**//*
*--------------- BuildSel(str,sel) -----------------
* BuildSel(str,sel)
* 功能:通过str构建Select.
* 参数:str,字符串,由服务端返回的.有特定结构"字符串1,字符串2,字符串3"
* 参数:sel,要构建的Select
* 实例:BuildSel(unescape(oBao.responseText),document.all.sel2)
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-27 19:02
*--------------- BuildSel(str,sel) -----------------
*/
//先清空原来的数据.
sel.options.length=0;
var arrstr = new Array();
arrstr = str.split(",");
//开始构建新的Select.
for(var i=0;i<arrstr.length;i++)
...{
sel.options[sel.options.length]=new Option(arrstr[i],arrstr[i])
}
}
</script>
<select name="sel" onChange="GetResult(this.value)">
<option value="">请选择
<option value="19">福建省
<option value="21">湖北省
<option value="22">辽宁省
<select>
<select name="sel2"></select>
<script >...
<!--
function onselectchange()...{
num=document.send.class0.options[document.send.class0.selectedIndex].value;
switch(num)...{
case "0":
document.send.class1.options.length=4;
document.send.class1.options[00].text="A1";
document.send.class1.options[00].value=0;
document.send.class1.options[01].text="A2";
document.send.class1.options[01].value=1;
document.send.class1.options[02].text="A3";
document.send.class1.options[02].value=2;
document.send.class1.options[03].text="A4";
document.send.class1.options[03].value=3;
break;
case "1":
document.send.class1.options.length=6;
document.send.class1.options[00].text="B1";
document.send.class1.options[00].value=0;
document.send.class1.options[01].text="B2";
document.send.class1.options[01].value=1;
document.send.class1.options[02].text="B3";
document.send.class1.options[02].value=2;
document.send.class1.options[03].text="B4";
document.send.class1.options[03].value=3;
document.send.class1.options[04].text="B5";
document.send.class1.options[04].value=4;
document.send.class1.options[05].text="B6";
break;
}
}
//-->
</script>
<table width="400" border="1" cellspacing="0" cellpadding="0" align="center" bordercolordark="#9cc384" bordercolorlight="#FFFFFF">
<tr bgcolor="#E6F0DD" align="center">
<td>
<form method="post" action="a_list.asp" name="send" target="_blank">
<table width="62%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="44%" align="right">类别:</td>
<td width="56%">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="class0" onChange="onselectchange()">
<option value="2">** 选择一级类别 **</option>
<option value="0">A</option>
<option value="1">B</option>
</select>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<select name="class1">
<option value="1">** 选择二级类别 **</option>
</select>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
- 几个JS的实例
- 几个简单的js实例
- 几个简单的js实例
- 运用js跳转页面的几个实例
- JS-自定义滚动条的几个实例
- 几个SQL 的实例
- controller的几个实例
- sizeof的几个实例
- 正则表达式在js中的几个实例
- 几个常用的JS
- 不错的几个js
- 日期 的几个js
- 几个常用的js
- JS的几个注意事项
- 几个awk的使用实例
- oracle的循环几个实例
- Javascript应用的几个实例
- Javascript应用的几个实例
- .Net开发过程中安装、调试的常见问题与错误!!!
- java正则表达式
- DNS Function
- 用类做的链表
- 使用PHP快速生成Flash 动画
- 几个JS的实例
- Visual Studio 2008无法创建silverlight项目
- 推荐一个STL扩展库的网站
- Oracle 服务进程-简单介绍
- sybase convert 函数
- ioctlsocket
- RECON使用札记
- .386 指令学习
- 记录自己的java面试题目