﻿//首先我们创建一个XMLHttpRequest对象
//源码下载及讨论地址：http://www.51aspx.com/CV/AjaxCheckUser

    var xmlHttp;
    
    function createXmlHttpRequest()
    {
        if(window.XMLHttpRequest)
        {
            xmlHttp=new XMLHttpRequest();
        
            if(xmlHttp.overrideMimeType)
                {
                    xmlHttp.overrideMimeType("text/xml");
                }
        }
        else if(window.ActiveXObject)
        {
            try
            {
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");   
            }
            catch(e)
            {
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");   
            }
        }
        if(!xmlHttp)
        {
            window.alert("你的浏览器不支持创建XMLhttpRequest对象");
        }
        return xmlHttp;
    }
function SearchPro(content)
{
     
     createXmlHttpRequest();
     var url="/Header.aspx?Event=Pro&Con="+escape(content)+"";;
      xmlHttp.open("post",url,true);
    
        xmlHttp.onreadystatechange=SearchProResult;
    
        xmlHttp.send(null);
}
function SearchProResult()
{
    if(xmlHttp.readyState==4)//服务器响应状态
    {
        if(xmlHttp.status==200)//代码执行状态
        {
         parent.location.href=xmlHttp.responseText;
            
        }
    }
}


