Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/10/2006, 14:44
Avatar de ikhuerta
ikhuerta
 
Fecha de Ingreso: octubre-2006
Mensajes: 104
Antigüedad: 17 años, 7 meses
Puntos: 0
Lo más comodo es que tras el onreadystate llames a otra función que se ejecutará solo cuando eso pase... esa otra función si que podrás controlarla...

Código:
XHR.onreadystatechange=function() { 	if (XHR.readyState==4) {
		if (XHR.status==200) {	
eval("proceso_ajax('"+XHR.responseText+"');");
						 }
  XHR.send(null); }

[...]
function proceso_ajax(respuesta)
{
 if (respuesta=='0') ejecuta_esto();
 else  if (respuesta=='1') ejecuta_esto_otro();

}