return new ActiveXObject(arguments.callee.activeXString);
}else{
throw new Error(“No XHR object available”);
}
}
//当第一个下拉框的选项发生改变时调用该函数
function changeSelect(){
var province = document.getElementById(‘province’).value;
var url = “select?id=”+ encodeURI(province);
xhr=creatXHR();
if(xhr){
xhr.open(“GET”,url,true);
//指定回调函数为callback
xhr.onreadystatechange = callback;
xhr.send(null);
}
}
//回调函数
function callback(){
if (xhr.readyState==4) {
if ((xhr.status>=200&&xhr.status<300)||xhr.status==304) {
parseMessage();
}else{
alert(“Request was unsuccessful:”+xhr.status);
}
}
}
//解析返回xml的函数
function parseMessage(){
var xmlDoc = xhr.respo