Hola que tengo que hacer una aplicacion en javascript. que es la siguiente =>
Crear una página web dividida en dos frames, en uno de ellos aparecen enlaces en forma de botones, al pulsar sobre uno de ellos la página que corresponde a dicho enlace
tiene que aparecer en el otro frame
y no lo consigo.
este es mi codigo
index.html
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>New Web Project</title>
</head>
<FRAMESET COLS=150,*>
<FRAME SRC="frame1.html" NAME=margen>
<FRAME SRC="frame2.html" NAME=principal>
</FRAMESET>
</html>
frame1.html
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frame1</title>
<script language="JavaScript">
function actualiza_1_frames()
{
window.parent.frames[1].location="frame2.html" ;
}
</script>
</head>
<body>
<input name="frame1" type="submit" class="enviar" value="frame1" onclick="javascript:actualiza_1_frames()"/>
</body>
</html>
frame2.html
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>frame2</title>
</head>
<body>
<p>frame 2 contenido</p>
</body>
</html>
sé muy muy poco de javascript. y para hacer esta tonteria de practica me estoy liando cada vez más. Estoy mirando tutoriales etc etc. pero no me aclaro con los frames.