﻿var xmlHttp; 
var RemindType;
function createXMLHTTP()
{
    if(window.XMLHttpRequest)
    {
        xmlHttp=new XMLHttpRequest();  
    }
    else if(window.ActiveXObject)
    {   
        try
        {
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");  
            
        }
        catch(e)
        {}
        try
        {
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
        }
        catch(e)
        {}
        try
        {
            if(!xmlHttp)
            {
                window.alert("不能创建XMLHttpRequest对象实例！");
                return false;
            }
         }
        catch(e)
        {}
    }
}   
 /*CallBackFunction为回调函数 例如:CallBackTitle
 plan为websever中的方法和要用的参数 例如：../Ajax/WebAjax.asmx/GetTileName?name="+TbTitle+"&having="+encodeURI(having)+"
 GetTileName为webserver中方法,name为参数 
 */
function AjaxFunction(CallBackFunction,Url)
{             
    createXMLHTTP();//创建XMLHttpRequest对象  
    RemindType=Url;    
    xmlHttp.open("GET",Url,true);  
    xmlHttp.onreadystatechange=eval(CallBackFunction);
    xmlHttp.send(null);  
}  
//执行检测教材课程名回调函数
function AjaxTableTime()
{

    if(xmlHttp.readyState==4)//判断对象状态  
    {   
        if(xmlHttp.status==200)//信息成功返回，开始处理信息 
        {    
             document.getElementById("SpanTableTime").innerHTML=xmlHttp.responseXML.getElementsByTagName("string")[0].firstChild.data  
           
        } 
    }
}    
  