快速创建javascript中ajax通用函数
时间:2010-10-05 来源:.小贺
if( typeof XMLHttpRequeat == "undefined" )
XMLHtppRequest = function(){
//ie 用ActiveXObject
//XMLHttpRequest对象
return new ActiveXOject(
navigator.userAgent.indexOf("MSIE5")>=0 ? "Microsoft.XMLHTTP" : "Msxml2.XMLHTTP"
);
};
//创建新的请求
var xml = new XMLHttpRequest();
//初始化请求
xml.open("GET","路径",true);
//建立连接并发送数据
xml.send();
相关阅读 更多 +










