﻿// JScript 文件
  function ajaxRead(file,fun,responseType,postType,QueryString){
   var xmlObj = null;
   if(window.XMLHttpRequest){
      xmlObj = new XMLHttpRequest();
   } else if(window.ActiveXObject){
      xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      return;
   }

   xmlObj.onreadystatechange = function(){
    if(xmlObj.readyState == 4){
		if (xmlObj.status ==200){
			if (responseType){
				obj = xmlObj;
			}
			else{
				obj = xmlObj.responseXML;
			}
			if (fun){
				eval(fun);
			}
			else{
				alert("AJAX not found Function with return.");
			}
		}
		else{
			alert("AJAX read data have error,error number is [" + xmlObj.status  + "]");
		}
    }
   }
   if (postType!="POST"){
	   postType = "GET";
	   QueryString = null;
   }
	xmlObj.open (postType, file, true);
	if (postType=="POST"){
		xmlObj.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");  //设置服务器响应请求体参数
	}
	xmlObj.send (QueryString);
  }

