87,997
社区成员




var xmlHttp; //创建的一个全局的变量
function createxmlhttp(){
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}; //给这个全局附直
window.onload = function(){
createxmlhttp();
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 4)
alert(xmlHttp.responseText)
};
xmlHttp.open("GET","GetDataService?method=getProvinceByCountry&countryID=86",true)
xmlHttp.send(null);
};
//在这个以上的地方 ie ff 下都是对的了 都可以alert出来数据
//在这个以下的地方 Set方法绑定在一个按纽上 ff下可以弹出数据(不管安多少次) ie却不行 怎么办了?
function Set(){
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 4)
alert(xmlHttp.responseText)
};
xmlHttp.open("GET","GetDataService?method=getProvinceByCountry&countryID=86",true)
xmlHttp.send(null)
};