您的位置:首页 > Web前端 > JQuery

Jquery创建ajax简单实例代码

2013-09-05 20:22 260 查看
Jquery创建ajax简单实例代码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;
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: