Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/06/2009, 06:59
Lleoun
 
Fecha de Ingreso: febrero-2008
Mensajes: 63
Antigüedad: 17 años, 2 meses
Puntos: 0
Autorefresh de ajax no funciona en Internet Explorer 6

Hola a todos,

El código de más abajo recarga mipagina.php cada 3 segundos sin que la página parpadee, es decir, sin que el usuario vea nada recargándose.

Funciona genial en todos los navegadores salvo en Internet Explorer 6.

¿Algún mago de Ajax que pueda hacer que el script se lleve también con Interntet Explorer 6?

Se puede ver la página aquí:
http://vivocom.es/test/prensa/index_autorefresh.html
Si la veis con IE6 comprobareis que el texto se queda sin moverse, pero que la imagen parpadea cada 3 segundos.

Muchas gracias de antemano!!

Código:
<script type="text/javascript">
function getHTTPObject() {
 
 var request = false;
        try {
            request = new ActiveXObject('Msxml2.XMLHTTP');
        }
        catch (err2) {
            try {
                request = new ActiveXObject('Microsoft.XMLHTTP');
            }
            catch (err3) {
                                try {
                                request = new XMLHttpRequest();
                                }
                                catch (err1) 
                                {
                                request = false;
                                }
            }
        }
    return request;
 
}
 
var ajaxRequest = getHTTPObject(); // creamos HTTP Object
 
setInterval(getPagina, 3000); // 3 segundos
function getPagina() {
 
            //    ajaxRequest.open("GET", "mipagina.php", true);
            ajaxRequest.open("GET", "mipagina.php"+"?dummy="+new Date().getTime(), true)
                ajaxRequest.onreadystatechange = showPagina;
           //     ajaxRequest.send(null); 
           ajaxRequest.send(''); 
                
}
                        
function showPagina()
{
                if(ajaxRequest.readyState == 4){

                  var ajaxDisplay = document.getElementById('mostrar');
                  ajaxDisplay.innerHTML = ajaxRequest.responseText;

                                
                }                                               
}
window.onload=function(){
        getPagina(); 
}
</script>

</head>
<body>

<div id="mostrar" ></div>
mipagina.php

Código:
<?php
echo"Here a text that don't blink but the image below does it (when using IE6) every 3 seconds 
<br><br><img src='http://dertompson.com/wp-content/uploads/2008/03/memory-verlauf-ie-reload.png'>";
?>