﻿// JScript 文件
var xmlHttp=null;
        
if (window.XMLHttpRequest)
  {
      xmlHttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
  } 
function GetTheLastChat()
{
    if(xmlHttp)
    {
        var callback = function (result)
        {  
            if (xmlHttp.readyState == 4) {
                  if (xmlHttp.status == 200){
                        var response = xmlHttp.responseText;
//                        alert(response);
                        document.getElementById("crl").innerHTML = response; 
//                        SetLocation();                                
                  }
             }

         }
    
         var d = new Date();
         var longtime = d.getFullYear() + "" + d.getMonth() + "" + d.getDay() + "" + d.getHours() + "" + d.getMinutes() + "" + d.getSeconds();
         var url = "ChartRoom/GetLastChat.aspx?t=" + longtime; 
         xmlHttp.open("GET", url,false); 
         try
         {//for FF
             xmlHttp.onreadystatechange = this.callback; 
         }
         catch(e)
         {//for IE
             xmlHttp.onreadystatechange = callback; 
         }
         xmlHttp.send(null); 
         window.setTimeout("GetTheLastChat()",1000);
    }
}
