Ver Mensaje Individual
  #2 (permalink)  
Antiguo 06/02/2007, 18:46
javierrm
 
Fecha de Ingreso: abril-2004
Ubicación: Morelos, México
Mensajes: 124
Antigüedad: 20 años
Puntos: 0
Re: Como detecto si un pagina termino de abrirse

Encontre el siguiente error al momento en que se manda a llamar a la funcion por primera vez........
xmlhttp.open("GET",url,true);


en el codigo donde ejecuto el abrir el script estado.php, me manda el siguiente error:
"Permission denied to call method xmlrequest.open"

A que se debe, si esta misma instruccion cuando se recarga el inicio.html carga bien los valores......

Código PHP:
function loadXMLDoc(url)
{

    // code for Mozilla, etc.
if (window.XMLHttpRequest)
  {
      xmlhttp=new XMLHttpRequest();
    
/*      if (xmlhttp.readyState == 0){
      //alert("no se a inicializado");
     //xmlhttp.open("POST",url,false);

      try {

        xmlhttp.open("GET", url, true);

      } catch (e) {

        alert("No se ha inicializado, ERROR: "+e);
        //window.open("http://localhost/Consola/index.html","","") 
        //document.location.href="http://localhost/Consola/index.html";
        //document.location.reload;
        //window.open(url,"","") 
         //InitComm('<?= $producto;?>', '<?= $Hoja;?>', '<?= $SERVER_ADDR;?>' );
        
      }
      
      }
      */
      xmlhttp.onreadystatechange=state_Change;
      /*if (xmlhttp.readyState == 0){
        
        //window.location.href = url;
        alert (url);
        //window.location.reload(true);
        //InitComm();
}*/
/*        url = "http://localhost/Consola/estado.php";
    xmlhttp.open("POST",url,false);
    xmlhttp.send("producto=PRODUCTO1&Hoja=1");
    //xmlhttp.send(null);
      //alert("xmlhttp.status con post:"+xmlhttp.status);

    }
    else{*/
      //alert("xmlhttp.status-antes:"+xmlhttp.status);
    //alert (xmlhttp.readyState);
    var tempo = false;
    try{
        //url = "http://localhost/Consola/estado.php";
        xmlhttp.open("GET",url,true);
        xmlhttp.send(null);
    }catch(e){
        alert (url+e);
        /*window.location.reload(true);
        windows.location.href=url;*/
         /*xmlhttp=new XMLHttpRequest();
        url = "http://localhost/Consola/estado.php";
        xmlhttp.open("GET",url,true);
        xmlhttp.send("producto=PRODUCTO1&Hoja=1");*/
    InitComm();        

    }
    //alert ("tempo"+tempo);
    if (xmlhttp.readyState==0){
        
        //window.location.href = url;
        //alert (url);
        //window.location.reload(true);
        //InitComm();
}

    //xmlhttp.send(null);
    //}
      
  }
// code for IE
else if (window.ActiveXObject)
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    if (xmlhttp)
    {
    xmlhttp.onreadystatechange=state_Change;
    xmlhttp.open("GET",url,true);
    xmlhttp.send();
    }
  }
  
}
Nose como decirle para que cargue la informacion y su ejecucion del script estado.php y despues que lea su xml correctamente.


NOTA: en la segunda vez lo hace bien......