阅读背景:

Ajax无法在客户端域中工作。但是在我的域中工作,也在localhost中工作

来源:互联网 
function getXMLHTTP() { 

    var xmlhttp=false;  

    try
    {
        xmlhttp=new XMLHttpRequest();
    }
    catch(e)    {       
        try{            
            xmlhttp= new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e){
            try{
            xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
            catch(e1){
                xmlhttp=false;
            }
        }
    }

    return xmlhttp;
}

function display_state(countryIdTEXT) 
{   
    var countryId = countryIdTEXT;
     alert(countryId);
    if(countryId !='')
    {   
         var strURL="select_state.php?con_name="+countryId;//alert(cate_id);
         alert(strURL);
         var req = getXMLHTTP();

        if (req) {

            req.onreadystatechange = function() {
                if (req.readyState == 4) {
                    // only if "OK"

                        document.getElementById('content').innerHTML=req.responseText;                      

                }               
            }           
            req.open("GET", strURL, true);
            req.send(null);
        }       
    }
}
function getXMLHTTP() { 

    var xmlhttp=false



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: