Faço conformeSegue o exemplo abaixo:
try{
xmlhttp = new XMLHttpRequest();
}catch(ee){
try{
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){
try{
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}catch(E){
xmlhttp = false;
}
}
}
function pegarCep( CEP ){
if( CEP.length==0) return false;
var divCep = document.getElementById('divCep');
divCep.innerHTML = "Carregando...";
xmlhttp.open("GET", "/cadastro-sms/br/cep.asp?CEP="+ CEP,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4){
var resposta = xmlhttp.responseText;
divCep.innerHTML = resposta;
}
}
xmlhttp.send(null);
}