⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 citiesstates.htm

📁 Windows Web脚本开发指南/(美) Dan Heflin, Todd Ney著 的源码
💻 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 + -