Frame it on the fly

I have a framed site, with a left frame and a right frame. The left frame displays the contents page and the right page displays the page depending on the link clicked in the left frame.

If a person opens the right frame page directly by typing the url in his/her browser, the page obviously will open with the frames.

I wish to make sure that even if the person does that, the frames are built on the fly, again with the left frame containing the contents page and the right page containing the page that has been called.

I hope I am clear enough and am lookking for javascript coding to do this.
LVL 3
rag2000Asked:
Who is Participating?
 
a.marshConnect With a Mentor Commented:
I think you'll find this article right up your street:

http://tech.irt.org/articles/js126/index.htm

:o)

Ant
0
 
a.marshCommented:
You mean you don't want the right hand page to be displayed without the left hand frame?

Ant
0
 
ykf2000Commented:
Hi,

you can try this in the right frame:

<script language="javascript">
 if(document.parent == null)
    document.location.href="your_frame_page.htm";
</script>


this will check whether there is a frame if not it will redirect to the frame page.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.