Ver Mensaje Individual
  #11 (permalink)  
Antiguo 07/12/2006, 05:13
yaviz
 
Fecha de Ingreso: diciembre-2004
Mensajes: 371
Antigüedad: 19 años, 5 meses
Puntos: 0
Re: problema con getElementById

Hola ya me ayudo a hacerlo un amigo y os lo pongo aqui por si a alguien le pudiera servir


Código:
PAGINA1

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>Prueba</title>
		<script type="text/javascript">
			function abrir(){
				mi_ventana=window.open('pagina2.html');
				mi_ventana.document.getElementById('datos').value= document.getElementById('datos').value;
			}
		</script>
	</head>
	<body>
		  <textarea id="datos" rows="10" cols="10">copiar este texto</textarea>
		
		<input type="button" value="Abrir" onclick="javascript: abrir()" />
	</body>
</html>

PAGINA2<!--en esta pagina no se puede insertar codigo-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
  		<title>Prueba 2</title>
	</head>
	<body>
				  <textarea id="datos" rows="10" cols="10"></textarea>

	</body>
</html>
Decir que unicamente en mozilla no funciona da error de la consola de javascript.

Aunque ahroa el problemilla que tengo es que en la pagina2 el textarea no tiene un ID solo tiene NAME y necesito algo que sustituya al getElementById por getElementByName, aunke se ke esto ultimono existe