Jquery创建ajax简单实例代码
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;
}
}