function loadXMLDoc(url)
{
xmlhttp=null;
if (window.XMLHttpRequest)
  {// code for IE7, Firefox, Opera, etc.
  xmlhttp=new XMLHttpRequest();
  }
else if (window.ActiveXObject)
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
if (xmlhttp!=null)
  {
  xmlhttp.onreadystatechange=state_Change;
  xmlhttp.open("GET",url+"&ids="+Math.random(),true);
  xmlhttp.send(null);
  }
else
  {
  alert("你的浏览器不支持！");
  }
}

function state_Change()
{
if (xmlhttp.readyState==4)
  { 
  if (xmlhttp.status==200)
    { 
         var str=xmlhttp.responseText;
        str=str.replace(/(^\s*)|(\s*$)/g, "");
        document.getElementById("hits").innerHTML="您是本网站第"+str+"位访客";
          
    }
  else
    {
       document.getElementById("hits").innerHTML="您是本网站第10000001位访客";
    }
  }
}
