[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Linking out to a web page from within frameset.

Posted on 2005-04-09
10
Medium Priority
?
150 Views
Last Modified: 2013-11-19
URL:  http://www.century21reu.com/frameset.htm

I've created a frameset with top and bottom frames. I have navigation links in both frames. When I click on a link it pulls the page into the top or bottom frame. How do I get it to go to the web page instead of wanting to display the web page in the frame?

You can view the problem at: http://www.century21reu.com/frameset.htm
0
Comment
Question by:MaryAnnWalsh
  • 6
  • 4
10 Comments
 
LVL 6

Expert Comment

by:Andy
ID: 13745462
You need to set the target attribute of the link to the name of the main frame...

eg:

<a href="/buy/index.php" target="mainFrame"><img src="/images/actBuy.gif" width="93" height="42" border="0"></a>
0
 

Author Comment

by:MaryAnnWalsh
ID: 13749513
Thank you for taking on my problem by providing a solution.

I did what you suggested but only to the first link "buy" no sense doing them all until I know the code works.

If you look at the site, you'll see I'm still experiencing the problem. Here's my new code. REMEMBER I said I only applied the code to the first link. I won't do anything to the bottom frame until I get the top frame working.
______________________________________________________________

   <tr>
    <td><table width="65%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><a href="/buy/index.php" target="mainFrame"><img src="/images/actBuy.gif" width="93" height="42" border="0"></a></td>
          <td><a href="/sell/index.php"><img src="/images/actSell.gif" width="87" height="42" border="0"></a></td>
          <td><a href="/about/index.php"><img src="/images/actAbout.gif" width="120" height="42" border="0"></a></td>
          <td><a href="/agents/index.php"><img src="/images/actAgents.gif" width="134" height="42" border="0"></a></td>
          <td><a href="/contact/index.php"><img src="/images/actContact.gif" width="113" height="42" border="0"></a></td>
        </tr>
_______________________________________________________________
I'll wait for your reply.
Mary Ann
0
 
LVL 6

Expert Comment

by:Andy
ID: 13751221
Well it's opening the page in the right frame now but the problem is that you are duplicating the header and the footer on that page. What you need to do is remove the code for both so that all that remains is the content for the 'Buy' page. See what I mean?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:MaryAnnWalsh
ID: 13752926
It has always been opening the page in the "main frame" That wasn't the problem.

I'm not quite sure if I understand what you mean.

If I were to delete all the code - say from the top frame, then wouldn't I have one active link and the rest dead links? And actually if I deleted the code, it would delete all my nav buttons except "Buy"

I'm envisioning you to be saying my code would look like this:
_____________________________________________________________________

  <tr>
    <td><table width="65%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><a href="/buy/index.php" target="mainFrame"><img src="/images/actBuy.gif" width="93" height="42" border="0"></a></td>
        </tr>
______________________________________________
Can you clarify a little more?
0
 
LVL 6

Expert Comment

by:Andy
ID: 13753093
Sorry, but no it hasn't. At least not when you first posted and I checked the site.

I went to your site and there was a top frame containing links, a main frame with the content and a bottom frame with the footer and more links. When I clicked on say the Buy link in the top frame it opened the new page in the same frame which is not what you want because you can't see it all. I checked the source and sure enough you didn't have the target attribute set so there's no way it would have known to open in the main frame. That's why I said to set that target attribute which you did for the Buy button.

Now when I check your site clicking the Buy button at the top opens the new page in the main frame like it should but that page also has the links on it so you end up with two lots of links at the top which looks odd.
0
 

Author Comment

by:MaryAnnWalsh
ID: 13753191
I really don't want the Buy page to open in the main frame.

There is an existing web page: http://www.century21reu.com/buy/index.php and I want the Buy link in the top header to take the user to this page.

Guess I didn't explain myself very well. I knew what I wanted but didn't explain myself to you very well. Hope I'm clearer now.
0
 
LVL 6

Expert Comment

by:Andy
ID: 13753199
If you are going to work with these frames then remember...

The content of the top frame will always be the same page. There is no need to change it in your case because it's a header and contains your navigation links.

The same applies to the bottom frame as it contains your footer and a secondary set of links.

The purpose of these links is to display relevant content in the main frame so all those links must have the target attibute set to the name of the main frame otherwise they will open the pages in the frame that they currently occupy.

The pages that will be displayed in the main frame do not need to have those links on as well.
0
 
LVL 6

Accepted Solution

by:
Andy earned 1200 total points
ID: 13753215
Oh I see... you want the page to open in a new window completely?

In that case set the target attribute of the link like this...

target="_blank"
0
 

Author Comment

by:MaryAnnWalsh
ID: 13753536
That's what I needed.

Now the Buy link goes to the page outside the frameset except when I put "_blank" the framed page was acting as the controlling page. So I changed the "_blank" to "_parent" and I was then allowed to go backward if I wanted.

I've always used the "_blank" and am not sure how the "_parent" or the "_top" or "_self" work so if I should need to choose a different one than "_parent" could you tell me which would be the best choice.

Thanks for your help.

Mary Ann

0
 
LVL 6

Expert Comment

by:Andy
ID: 13753674
Parent should be fine but FYI...

_blank = Loads the linked document into a new browser window.

_self = Defualt action for all anchor tags. Any linked document with this target will load into the same window as the link.

_parent = Linked document will be loaded into the parent window or frameset. If there is only one frameset, the document will be loaded into the browser window. If there are nested framesets the document will be loaded into the next level frameset up.

_top = Removes all framesets and loads the linked document into the top level window of the browser.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question