Saturday, 17 August 2013

Changing two frames with one click worked , but going 'back' to only one of the frames

Changing two frames with one click worked , but going 'back' to only one
of the frames

I was able to implement the change of two frames with one click with the
help of the tutorial (http://www.pageresource.com/html/frame4.htm). But
one issue is there, that is when I press the browser's Back button, it is
not returning to the previous page, but instead will only change one of
the frame back.
I have given my pages below ( except page2.html, page3.html and page4.html
as they can be anything)
Could you please help me with a javascript which will rectify this issue.
This is the frameset code
<html>
<head>
</head>
<frameset rows="20%,80%">
<frame src="page1.html" name="top_frame">
<frame src="page2.html" name="bottom_frame">
</frameset>
</html>
and this is page1.html
<html>
<head>
<title>My Site</title>
<script language="JavaScript" type="text/javascript">
function change2(url)
{
parent.bottom_frame.location=url;
}
</script>
</head>
<body>
Click the link below to change both frames.
<br />
<a href="page4.html" target="top_frame"
onclick=change2('page3.html')>change 2 frames</a>
</body>
</html>

No comments:

Post a Comment