Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/04/2008, 15:24
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: Problema al redireccionar a otra pagina, al finalizar llamada Ajax

Mmm prueba esto:
Código:
function aj(){
	if(window.XMLHttpRequest){
		return new XMLHttpRequest();
	} else {
		try{
			return new ActiveXObject('Microsoft.XMLHTTP');
		}catch(e){
			alert('tu navegador no soporta ajax');
			return false;
		}
	}
}

function navAway() {
	document.getElementById('loading_tablas').style.display='none';
	window.location = 'index.php?seccion=2&act=3';
}

function Rellenar_Bd( url ) {
	document.getElementById('contenedor').style.height="650px";
	document.getElementById('loading_tablas').style.display='inline';
	
	var theURL = url + "&" + Math.random();
	Runner.run( theURL, navAway, 700 );
}

var Runner = function(){
	var timer;
	var f = function(url, cb){
		return function(){
			var rpc2=aj();
			if( rpc2 ) {
				rpc2.open('GET',url,true);
				rpc2.onreadystatechange=function(){
					if( rpc2.readyState == 4 ) {
						var actualizo = rpc2.responseText;
						if( actualizo == 1 ) {
							window.clearInterval(timer);
							cb();
						}
					}
				};
			}
	
			rpc2.send(null);
		};
	};
	return {
		run : function(url, cb, ms) {
			timer = window.setInterval(f(url, cb), ms);
		}
    }
}();
No lo he probado, pero creo debería de funcionar.