Foros del Web » Programando para Internet » Javascript »

Problema de visualización en IE

Estas en el tema de Problema de visualización en IE en el foro de Javascript en Foros del Web. Muy buenas, compañeros! Mirad, tengo un problema: Cuando visualizo el documento HTML en Firefox, se ve todo correctamente. Pero cuando lo pongo en IE... ¡no ...
  #1 (permalink)  
Antiguo 20/10/2011, 05:05
 
Fecha de Ingreso: junio-2009
Mensajes: 156
Antigüedad: 14 años, 10 meses
Puntos: 7
Pregunta Problema de visualización en IE

Muy buenas, compañeros! Mirad, tengo un problema: Cuando visualizo el documento HTML en Firefox, se ve todo correctamente. Pero cuando lo pongo en IE... ¡no se ve nada!
¿Alguien podría decirme por qué? ¿y alguna manera de solucionarlo?
Como siempre, muchas gracias!


Documento XML
Código PHP:
<CATALOGO>
     <
PRODUCTO ref="0">
          <
NOMBRE>xxxxxxxxxxxxx</NOMBRE>
          <
DESCRIPCION>Esto es una prueba de xml</DESCRIPCION>
          <
QUOTE>Probando xml</QUOTE>
          <
FOTO1>../img/p1.jpg</FOTO1>
          <
FOTO2>../img/p2.jpg</FOTO2>
          <
FOTO3>../img/p3.jpg</FOTO3>
          <
FOTO4>../img/p4.jpg</FOTO4>
          <
FOTO5>../img/p5.jpg</FOTO5>
          <
FOTO6>../img/p6.jpg</FOTO6>
          <
MARCA>xxxxxxxxxxxxxxx</MARCA>
     </
PRODUCTO>
</
CATALOGO
Documento HTML
Código PHP:
<html>
    <
head>
        <
style>
            
body{font-family:VerdanaGenevasans-serifmargin:0padding:0;}
            
h1{font-size:2em;}
            
h2{font-size:1.5em;}
            
h3{font-size:1em;}
            
img{padding:5px;}
            
#contenedor{width:auto; height:auto; background:#CCC; border:1px solid #666; padding-left:50px; padding-bottom:10px;}
        
</style>
    </
head>
    <
body>
    
    <
script type="text/javascript">
        if (
window.XMLHttpRequest){
            
xmlhttp=new XMLHttpRequest();
            }
            else {
                
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
                }
                
        
xmlhttp.open("GET","productos.xml",false);
        
xmlhttp.send();
        
xmlDoc=xmlhttp.responseXML;
        
        var 
x=xmlDoc.getElementsByTagName("PRODUCTO");
        var 
ref=1;
        var 
y=x[ref];
          
document.write("<div id='contenedor'>");
          
document.write("<h1>");
          
document.write(y.getElementsByTagName("NOMBRE")[0].childNodes[0].nodeValue);
          
document.write("<h1><h2>");
          
document.write(y.getElementsByTagName("DESCRIPCION")[0].childNodes[0].nodeValue);
          
document.write("</h2><h3>");
          
document.write(y.getElementsByTagName("QUOTE")[0].childNodes[0].nodeValue);
          
document.write("</h3><img src='");
          
document.write(y.getElementsByTagName("FOTO1")[0].childNodes[0].nodeValue);
          
document.write("'/><img src='");
          
document.write(y.getElementsByTagName("FOTO2")[0].childNodes[0].nodeValue);
          
document.write("'/><img src='");
          
document.write(y.getElementsByTagName("FOTO3")[0].childNodes[0].nodeValue);
          
document.write("'/><img src='");
          
document.write(y.getElementsByTagName("FOTO4")[0].childNodes[0].nodeValue);
          
document.write("'/><img src='");
          
document.write(y.getElementsByTagName("FOTO5")[0].childNodes[0].nodeValue);
          
document.write("'/><img src='");
          
document.write(y.getElementsByTagName("FOTO6")[0].childNodes[0].nodeValue);
          
document.write("'/>");
          
document.write("</div>");
    
</script>
    
    </body>
</html> 
  #2 (permalink)  
Antiguo 20/10/2011, 05:56
Avatar de IsaBelM
Colaborador
 
Fecha de Ingreso: junio-2008
Mensajes: 5.032
Antigüedad: 15 años, 10 meses
Puntos: 1012
Respuesta: Problema de visualización en IE

has de estar en el servidor (local o web)

Etiquetas: document.write, explorer, firefox, xml
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:43.