function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest(url,returnfun) {
createXMLHttpRequest();
xmlHttp.onreadystatechange =returnfun;
xmlHttp.open("GET",url,true);
xmlHttp.send(null);
}
function weatherStateChange(){
if(xmlHttp.readyState == 4){
$("ipweather").innerHTML=xmlHttp.responseText;
}
}
时间: 2024-10-10 13:17:15