var xmlHttp = createXmlHttpRequestObject(); 
function createXmlHttpRequestObject() 
{ 
var xmlHttp;
if(window.ActiveXObject)
{
    try
    {
      xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    catch (e) 
    {
      xmlHttp = false;
    }
}
else
{
    try 
    {
      xmlHttp = new XMLHttpRequest();
    }
    catch (e) 
    {
      xmlHttp = false;
    }
}
if (!xmlHttp)

    alert("Error creating the XMLHttpRequest object.");
else 
    return xmlHttp;
}

function process(url,val)
{	
	url = url+"&time="+(Math.random());//加随机数
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == 0)
	{
		xmlHttp.open("GET",url+"&to_uid="+val, true);
		xmlHttp.onreadystatechange = handleServerResponse;
		xmlHttp.send(null);
	}
}
function handleServerResponse()
{
if (xmlHttp.readyState == 4) 
{
    if (xmlHttp.status == 200) 
    {
		xmlResponse = xmlHttp.responseText; //将响应信息作为字符串返回 
		//alert(xmlResponse);
		ss=xmlResponse.split('|');// 分割传递过来的值
		//alert(xmlResponse);
		divid=ss[1]; //文章id
		document.getElementById(divid).innerHTML =ss[0]; //将字符串写入到页面中 这里一定不要忘记引号。
    } 
    else 
    {
      alert("There was a problem accessing the server: " + xmlHttp.statusText);
    }
}
}



