study009
来源:互联网 发布:2016最流行的网络词语 编辑:程序博客网 时间:2024/05/21 09:20
009.htm
<html>
<head>
<title>study 009</title>
<script language="javascript" type="text/javascript" src="sort.js"></script>
</head>
<body>
<h1>排序</h1>
<form name="theform">
列表:<input type="text" name="newname" size="20">
<input type="button" name="addname" value="添加" onClick="SortNames();">
<h2>字符串结果</h2>
<textarea cols="60" rows="10" name="sorted1">
输出结果
</textarea>
<h2>数值结果</h2>
<textarea cols="60" rows="10" name="sorted2">
输出结果
</textarea>
</form>
</body>
</html>
<head>
<title>study 009</title>
<script language="javascript" type="text/javascript" src="sort.js"></script>
</head>
<body>
<h1>排序</h1>
<form name="theform">
列表:<input type="text" name="newname" size="20">
<input type="button" name="addname" value="添加" onClick="SortNames();">
<h2>字符串结果</h2>
<textarea cols="60" rows="10" name="sorted1">
输出结果
</textarea>
<h2>数值结果</h2>
<textarea cols="60" rows="10" name="sorted2">
输出结果
</textarea>
</form>
</body>
</html>
sort.js
var numnames = 0;
var names = new Array();
function SortNames()
...{
thenname = document.theform.newname.value;
names[numnames++] = thenname;
names.sort();
document.theform.sorted1.value = names.join(" ");
names.sort(NumCompare);
document.theform.sorted2.value = names.join(" ");
}
function NumCompare(a, b)
...{
return a - b;
}
var names = new Array();
function SortNames()
...{
thenname = document.theform.newname.value;
names[numnames++] = thenname;
names.sort();
document.theform.sorted1.value = names.join(" ");
names.sort(NumCompare);
document.theform.sorted2.value = names.join(" ");
}
function NumCompare(a, b)
...{
return a - b;
}
- study009
- study009
- 学习 CleanupStack
- Html细线表格的实现
- 用AppFramework重写Discuz数据访问层源代码
- JBoss 文档(三)——JBoss和JMS
- 开发JRun的JMS服务指南
- study009
- study009
- JBoss 4.0.2集群指南(二)-建立JMS集群
- JBoss 4.0.2集群指南
- 推荐:嵌入式开发中2.6内核移植patches
- 关于IP Centrex与IP PBX方案应用的优缺点
- Red hat 9 参考手册 第一章 (全)
- The JBoss 4 Application Server Clustering Guide
- 关于Winnet的若干整理