Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/07/2010, 07:26
xziolhvinvhgl
 
Fecha de Ingreso: marzo-2010
Mensajes: 68
Antigüedad: 14 años, 1 mes
Puntos: 0
Respuesta: Problemas con XMLHTTPREQUEST. Estado de respuesta siempre 0

hola... tal ves no es que buscas , pero esta me va de maravilla...

function XMLHttp(){
var Object;
if(typeof XMLHttpRequest == "undefined"){
if(navigator.userAgent.indexOf("MSIE 5") >=0){
Object = new ActiveXObject("Microsoft.XMLHTTP");
}
else{
Object = new ActiveXObject("Msxml2.XMLHTTP");
}
}
else{
Object = new XMLHttpRequest();
}
return Object;
}

y para ejecutarla..

function verificarCedula(cedula){
ajax = new XMLHttp();
ajax.open('GET','verificarCedula.php?cedula='+cedu la,true);
ajax.send(null);
ajax.onreadystatechange=function(){
if((ajax.readyState == 4) && (ajax.status == 200)){
var resp = ajax.responseText;
}
}
}

ya pues la variable "resp" esla respuesta enviada por la pagina "verificarCedula.php"...

espero te sirva