Ver Mensaje Individual
  #16 (permalink)  
Antiguo 06/02/2008, 16:14
consigna
 
Fecha de Ingreso: enero-2008
Mensajes: 57
Antigüedad: 16 años, 3 meses
Puntos: 0
Re: Refrescar porcentaje de barra de progreso

La verdad que si es raro, porque en explorer funciona a la perfeccion. mi codigo de progreso.html es

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>test</title>
<
style>
#marco{
width:300px;
border:2px solid #000;position:relative;
}
#barra{
width:0background-color:#0099FF;
}
#estado{
position:absoluteleft:50%;
}
</
style>
<
script>
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;
        }
    }
}
var 
porciento;
function 
rpc(url){
   var 
rpc=aj();
    if(
rpc){
        
rpc.open('GET',url,true);
        
rpc.onreadystatechange=function(){
            if(
rpc.readyState==4){
                
porciento=rpc.responseText;
            }
        }
        
rpc.send(null);
    }
}

function 
progress(porcentaje){
document.getElementById('barra').style.width=document.getElementById('estado').innerHTML=porcentaje+'%';
}

window.onload=function(){

var 
pp=setInterval(function(){
  if(
typeof porciento!='undefined')
      
progress(porciento);
  if(
porciento>99){
     
clearInterval(pp);
     
document.location.href='index.php?seccion=2&act=1';
  };
  
rpc('procesando.php?'+Math.random());},50);
}
</script>
</head>

<body>
<div id="marco"><div id="estado"></div><div id="barra">&nbsp;</div></div>
</body>
</html>