Forum Moderators: open

Message Too Old, No Replies

Sending page to a frame

Open page in frame two

         

Adam5000

6:19 pm on May 29, 2007 (gmt 0)

10+ Year Member



I've created a page with two frames. And I've got the code below in frame one. And what I'd like to do is use the code in frame one to automatically open page abc in frame two after five seconds.

The code below almost works except page abc opens in frame one and I'd like it to open in frame two. Help!

<html>
<head>
<title>frame one</title>

<script language="javascript">

function open_page_abc_in_frame_two()
{window.location.href="page_abc.htm"; target="frame_two";}

setTimeout("open_page_abc_in_frame_two()", 5000)

</script>

</head>

<body>
<p>Page abc will automatically appear in frame two in 5 seconds</p>
</body>
</html>

daveVk

1:24 am on May 30, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The javascript in frame1 is unaware of frame2 it will not find "frame_two" within frame 1. You need to move the script into the main page where both frames are visible to it. The call from frame2 then become window.opener.open_page_abc_in_frame_two().

This assumes all content is coming from same domain, else security will step in.

Adam5000

2:55 am on Jun 2, 2007 (gmt 0)

10+ Year Member



Thanks for your help Dave. That sounds right. And it's a bit of a complicated page so I'm going to give it a rest for a few days.