Ver Mensaje Individual
  #6 (permalink)  
Antiguo 07/02/2008, 16:12
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 18 años
Puntos: 2135
Re: Manipular XML con handler externo...

Pasale el parametro a tu funcion por decir, si se llama hazPeticionAJAX y dentro de ahi se llama, pasale el callback:
Código:
hazPeticionAJAX( '/path/archivo.xml', procesaXMLA );
function procesaXMLA( xml ) {
      // codigo para procesar
}

// luego en la firma de tu funcion de ajax pasas el callback:
function hazPeticionAJAX( url, cb ) {
       // init
       ajax.onreadystatechange = function() {
     if(ajax.readyState==4){
          if(ajax.status==200){
             var doc=ajax.response.XML;
                 cb( doc );
          }
     }  
}
}
Saludos.