28,409
社区成员




<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script type="text/javascript">
xmlHttp=null;
function getData(o)
{
if(o.value=="")
{
document.getElementById("x").innerHTML="请选择一个项目。";
}
url = "data" + o.value + ".asp"
xmlHttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = function()
{
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
document.getElementById("x").innerHTML=xmlHttp.responseText;
}
}
};
xmlHttp.send(null);
}
</script>
<select onchange="getData(this)">
<option>请选择
<option value=1>1
<option value=2>2
</select>
<div id=x></div>