﻿// JScript source code
  function ajaxRead(file){
   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){
			obj = xmlObj.responseXML;
			
			result = processXML(xmlObj.responseXML);
			
		}
		else{
			alert("读取文件出错,错误号为 [" + xmlObj.status  + "]");
		}
    }
   }
   
   xmlObj.open ('GET', file, true);
   xmlObj.send (null);
   
  }
   function processXML(obj){
      
      var res = obj.getElementsByTagName('result');
			var resContainer = document.getElementById("checkresult");
			var result = "";
			if (res[0] != null && res[0] != undefined)
			{
				if (res[0].childNodes.length > 1) {
					result = res[0].childNodes[1].nodeValue;
				} else {
					result = res[0].firstChild.nodeValue;    		
				}
			}
			
			return result;

   }
