Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/10/2011, 03:06
paskuini
 
Fecha de Ingreso: junio-2009
Mensajes: 156
Antigüedad: 14 años, 9 meses
Puntos: 7
document.write en lugar específico?

Hola de nuevo! alguien puede decirme cómo hacer un document.write en un div específico? No puedo usar innerHTML (creo) porque pasaría los datos como texto llano....
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(y.getElementsByTagName("NOMBRE")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("DESCRIPCION")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("QUOTE")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO1")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO2")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO3")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO4")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO5")[0].childNodes[0].nodeValue);
          
document.write("<br>");
          
document.write(y.getElementsByTagName("FOTO6")[0].childNodes[0].nodeValue);
    
</script>
    
    <div id="nombre"></div>
    <div id="descripcion"></div>
    <div id="quote"></div>
    <div id="foto1"></div>
    <div id="foto2"></div>
    <div id="foto3"></div>
    <div id="foto4"></div>
    <div id="foto5"></div>
    <div id="foto6"></div>
    
    </body>
</html>