www.webdeveloper.com
Results 1 to 6 of 6

Thread: opening a document in a frame

  1. #1
    Join Date
    Nov 2002
    Posts
    2

    opening a document in a frame

    Hello,
    I am in the process of creating my first site. It is done in a frameset. There are three frames. I have the navigation frame, a main frame and a third frame. The third frame is mainly for pics and stuff. What I am trying to do is have a blank page load into the third frame ( I have the blank page made) whenever a new page loads into the main page. Is there a way to do this? I have tried with the onLoad and some javascipt in the documents for the main window, but I do not know if I can reference the target third window for the blank document to load into. Can anybody help?

    Thanks,
    Deceeced

  2. #2
    Join Date
    Nov 2002
    Posts
    15
    Do you mean that when you open the frameset, the "blank" page opens where the "main" should be; or is that when you click a link, the "blank" one opens in the place of the "main"?

    Is there anyway you could post the code of that frameset and your links on the main one?

    Perhaps is just a matter of selecting the target frame when you define the links.

    Later

  3. #3
    Join Date
    Nov 2002
    Posts
    2
    k, here is my situation.
    I have the nested frameset setup like so:
    There is a frameset setup horizontally.
    There are two horizontal frames.
    The top one is used for the navigation bar (NAVIGATION).
    The bottom one has a nested frameset in it.
    This frameset is setup vertically.
    I have a vertical frame that takes up 300px on the left (LEFT).
    The rest is taken up by the second vertical frame (RIGHT).

    Now, when a user clicks on a link in the navigation bar, the page pops up in the RIGHT frame. However, the LEFT frame does not change.

    What I want to happen is:
    when a user clicks on a link in the navigation bar (in the NAVIGATION frame), the page they want will load in the main frame (the RIGHT frame), but also, anything in the secondary frame (the LEFT frame) should be cleared by having a blank html document load into it.

    I tried using simple javascript with the onLoad event in the documents body tag but to no avail. Any suggestions?

  4. #4
    Join Date
    Nov 2002
    Location
    Dartmoor [Holiday]
    Posts
    2,382
    You need to use javascript in the navigation bar, probably something like this:

    <a href="javascript:void(top.navigation.left.location = 'blank.html');void(top.navigation.right.location = 'page1.html');">Go to page1</a>

    This would show a hyperlink that, when clicked, displayed "blank.html" in the left frame and "page1.html" in the right frame. You might have to experiment with "top.navigation", as it might be "parent.navigation" or similar, I'm not sure.

    Good luck

    Adam

  5. #5
    Join Date
    Nov 2002
    Posts
    984
    Originally posted by deceeced
    I have a vertical frame that takes up 300px on the left (LEFT).
    The rest is taken up by the second vertical frame (RIGHT).
    Why not simply use an <iframe> to represent the left or right side and you won't need to rely on JavaScript to navigate on the site...

  6. #6
    Join Date
    Dec 2002
    Location
    The Netherlands
    Posts
    2

    Thumbs up Another try?

    Hello,

    Why don't you try :

    <a href="blankpage.htm" target="mainframe">

    You will have standard targets (e.g. _top, _parent,....)
    But also (when using frames) topframe, mainframe, leftframe... and so one...

    hope i help you.

    Gr.

    Dirk

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles