Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2006, 13:55
Avatar de monoswim
monoswim
$moderador{'Esteban'}
 
Fecha de Ingreso: febrero-2002
Ubicación: Buenos Aires - Argentina
Mensajes: 8.762
Antigüedad: 22 años, 3 meses
Puntos: 90
DOM XML IFRAME no funca...

Código:
<!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>Documento sin t&iacute;tulo</title>
<script>
function llenar(){
var arb = '<?xml version="1.0" encoding="iso-8859-1"?><caca><teta>teta</teta><cola>cola</cola><teta>teta2</teta></caca>';
window.frames.no.document.clear();
window.frames.no.document.open();
window.frames.no.document.writeln(arb);
window.frames.no.document.close();
pepe=document.getElementById('no').contentWindow.document.getElementsByTagName('teta').length;
alert(pepe);

pepa=document.getElementById('no').contentWindow.document.getElementsByTagName('teta')[0].firstChild.data;
alert(pepa);

var x = document.getElementById('no');
alert((x.contentDocument || x.contentWindow.document).documentElement.getElementsByTagName('teta')[0].firstChild.data);
}
</script>

</head>

<body onload="llenar()">
<iframe name="no" id="no"></iframe>
</body>
</html>
Porque me tira el length y no el contenido, el data ?

Saludos
__________________
Esteban Quintana