PDA

View Full Version : Frames, reloading entire frameset from within one frame



Morgenmuffel
22-06-2006, 01:04 PM
I hate frames and they confuse the heck out of me

but i need to use them for this project

I need to know how to move from my page which has 2 frames to another page that has no frames, currently the new page is opening in one of the frames which is not what i want

Any help would be appreciated

Skinnerjack
22-06-2006, 01:16 PM
Understanding the Basics
For most people, the hardest part of getting started using frames is understanding the basic idea of how the frames work. But it's really not that difficult, if you stop and think about it. The FrameSet page contains the basic details about the individual frames, such as their size, their name, and other optional properties, such as whether you want default scrolls or not.

Say you have a FrameSet that contains two frames. The first is named FrameOne; the second is FrameTwo. Normally, you would create a hyperlink just by telling the link what page should be displayed when the user clicks it, such as:

<a href="myWebPage.html">Click here for my web page.</a>

However, when dealing with frames, you need to also tell the link where you want the page displayed—in which frame, or the target. So a hyperlink located in your top menu frame that, when clicked, would display a picture in your large main frame below, might look like this:

<a href="myWebPage.html" target="MainFrame">Click here for my web page.</a>

Notice the additional target reference. If the first link was sitting in a top frame and the user clicked it, the resulting page would be displayed in the same frame. In other words, it would display within the same menu frame that you clicked. Obviously, not the desired result. But by providing a target, the page knows to go display itself inside the frame called MainFrame. The illustration below might help you better understand.

Take a look at the first image below. First you see the FrameSet showing the names of the frames. Next you see the two frames with the information they first contain. You can see that the top, MenuFrame, contains a hyperlink. The bottom, MainFrame, currently is blank. If you were to use a standard hyperlink tag, as shown in the first code sample above, the default target location would be the hyperlinks own frame. The photo you want displayed from the hyperlink click, would be displayed in the top, MenuFrame, rather than the bottom frame.



However, if you compare the image above, which uses the standard hyperlink, to the image below, which contains the hyperlink with the target tag, you can see that the photo will now be displayed in the proper MainFrame (target location) at the bottom.


many people don't like sites with frames and also that coding a site with frames is more difficult. So why bother? That's something you'll have to decide. Assuming you have a good reason, let the lesson continue!

Erayd
22-06-2006, 01:39 PM
...move from my page which has 2 frames to another page that has no frames.Use:
<a href="http://destination.com" target="_top">Link</a>Note that the '_top' is the important bit - it tells the browser to wipe the frameset and display the page in the entire window. If you want the link to display in a new window, use '_blank' instead.