function ajaxRequest(method,url,sync,param,responseFun){
//创建对象
var httpRequest;
if(window.XMLHttpRequest){
httpRequest= new XMLHttpRequest();
}else if(Window.ActiveXObject){
httpRequest= new ActiveXObject("Microsoft.XMLHTTP");
}
// 回调函数
httpRequest.onreadystatechange=function(){
if(httpRequest.readyState==4 && httpRequest.status==200) {
responseFun(httpRequest.responseText);
}
};
//发起请求
httpRequest.open(method,url,sync);
if(method=="post"){
httpRequest.setRequestHeader("Content-type","application/x-www-form-urlencoded");
}
//发送数据到服务器
httpRequest.send(param);
}