📄 citiesstates.htm
字号:
<html XMLNS:IE>
<head>
<title>Pick Either Cities or States</title>
</head>
<script language="JavaScript">
function getValues(){
var sFileName;
//clear the select
document.all.objSelect.length = 0;
//select the appropiate file
if (document.all.optSelectChoice(0).checked == true)
sFileName = 'cities.txt';
else
sFileName = 'states.txt';
//download the file
objDownload.startDownload(sFileName, onDownloadDone);
}
function onDownloadDone(data) {
var arrTemp;
var i;
var sTemp = new String;
//split the data into array elements
arrTemp = data.split("|");
//load the data into the select
for (i = 0; i < arrTemp.length; i++){
document.all.objSelect.length++;
document.all.objSelect.options[i].text = arrTemp[i];
}
}
</script>
<body bgcolor="#0099FF">
<IE:Download ID="objDownload" STYLE="behavior:url(#default#download)" />
<p align="center"><font size="5">Pick Either Cities or States</font></p>
<form >
<table border="0" width="364">
<tr>
<td width="106">Select Choice: </td>
<td width="116"><input type="radio" value="V1" checked name="optSelectChoice">Cities
<input type="radio" name="optSelectChoice" value="V2">States</td>
<td width="122"><input type="button" value="View Values" onclick="getValues()" name="btnSelectValues"></td>
</tr>
<tr>
<td width="106">Select Values:</td>
<td width="116"><select size="1" name="objSelect">
</select></td>
<td width="122"></td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -