客户端 jsp文件
<select id="province" name="province">
<option value="">请选择省份...</option>
</select>
<select id="city" name="city">
<option value="">请选择城市...</option>
</select>
javascript代码
function ajaxFunction(){
var xmlHttp;
try{ //Firefox
xmlHttp = new XMLHttpRequest();
}catch(e){
try{ //IE
xmlHttp = new ActiveXObject("Msxm12.XMLHTTP");
}catch(e){
try{
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){}
}
}
return xmlHttp;
}
window.onload = function(){
//获取xmlhttpRequest对象
var xmlReq = ajaxFunction();
//处理服务器的响应 ,实时监听
xmlReq.onreadystatechange = function(){
//alert(xmlReq.status);
if(xmlReq.rea