Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/06/2011, 20:14
nsaavedrab
 
Fecha de Ingreso: junio-2011
Mensajes: 2
Antigüedad: 12 años, 11 meses
Puntos: 0
Exclamación No funciona redireccionamiento en Firefox

Estimados espero que me ayuden con el problema que tengo lo que pasa es que tengo un codigo para hacer un login y cuando quiero direccionar a otra pagina en mozilla no me funciona pero en IE si, he probado con todos los metodos espero que me ayuden!

Código Javascript:
Ver original
  1. function crearAjax()
  2. {
  3.     var xmlhttp=false;
  4.      try
  5.     {
  6.       xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
  7.     }
  8.     catch (e)
  9.     {
  10.         try
  11.         {
  12.                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  13.           }
  14.         catch (E)
  15.         {
  16.                xmlhttp = false;
  17.           }
  18.      }
  19.     if (!xmlhttp && typeof XMLHttpRequest!='undefined')
  20.     {
  21.           xmlhttp = new XMLHttpRequest();
  22.     }
  23.     return xmlhttp;
  24. }
  25.  
  26.  
  27. function traerDatos()
  28. {
  29.     var user = document.logon.username.value;
  30.     var pass = document.logon.password.value;
  31.        
  32.     if(user=="" || pass ==""){
  33.         alert("Debe ingresar su usuario y contraseña");
  34.         return;
  35.     }
  36.     divResultado = document.getElementById('error');
  37.     ajax = crearAjax();
  38.     ajax.open("POST","verificaPage.php",true);
  39.     divResultado.innerHTML = "Cargando...";
  40.     ajax.onreadystatechange=function() {
  41.         if(ajax.readyState==4){
  42.             switch(ajax.responseText){
  43.                 case "a":
  44.                     document.location.href  = "adPage.php"; // ACA ESTA EL PROBLEMA YA QUE SI PONGO UN ALERT ME FUNCIONA !!!
  45.                     break;
  46.                 case "b":
  47.                     alert("Datos Incorrectos");
  48.                     break;
  49.             }//fin switch  
  50.         }//fin if  
  51.     }//fin funcion
  52.     ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  53.     ajax.send("usuario="+user+"&pass="+pass);
  54. }