Solved

Linking into a frame

Posted on 2002-03-12
14
172 Views
Last Modified: 2010-04-09
I asked a similar question a while ago. This one is a little bit more comlicated.

The original frame setup has three vertical frames, called "left," "center" and "right." At some point the user clicks on a link which loads a new page into "center." This new page contains a frameset which further divides "center" into two horizontal frames, called "top" and "main."

At some point the user chooses a link which brings up a new page (with target="_top") which is too wide to fit into the frame. This page (a calendar), which is now outside of the framesets, has links defined in it. Right now these links bring up little windows, which when closed, leave the calendar active.

What I need to do is to have some of the links from the calendar bring up new pages in the "main" frame, which you'll remember is within the "center" frame. Can I do it? How?

By the way, I'm not at liberty to change the frame setup I described above.
0
Comment
Question by:cbutton
  • 4
  • 4
  • 3
  • +1
14 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 6857818
If you can, rename your top frame from "top" to "topframe" because "top" is a javascript keyword.

From the calendar popup, do this:

<A href="#" onClick='parent.main.location="http://server.com/page.htm";return false;'>click here</a>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6857820
oops, instead of parent, do opener:

<A href="#" onClick='opener.main.location="http://server.com/page.htm";return false;'>click here</a>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6857821
or:

<A href="#" onClick='self.opener.main.location="http://server.com/page.htm";return false;'>click here</a>
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!

 
LVL 14

Expert Comment

by:avner
ID: 6857829
The full reference to the calander would be :

self.parent.parent.main

Which generally means , Go to the current window >> his parent (top), his parent (frame set of main and top) and from there get a reference to MAIN.

 And as far as I know, you'll have to use a JavaScript liknk to that, since you cannot use the HTML target=" attribute.

0
 
LVL 14

Expert Comment

by:avner
ID: 6857841
The full reference to the calander would be :

self.parent.parent.main

Which generally means , Go to the current window >> his parent (top), his parent (frame set of main and top) and from there get a reference to MAIN.

 And as far as I know, you'll have to use a JavaScript liknk to that, since you cannot use the HTML target=" attribute.

0
 
LVL 33

Expert Comment

by:knightEknight
ID: 6857859
good point, so:

<A href="#" onClick='self.opener.center.main.location="http://server.com/page.htm";return false;'>click here</a>
0
 

Author Comment

by:cbutton
ID: 6858630
Unfortunately none of these commentrs above work. I have tried each one and none of them even open the page. They all give an "error on page" status. Is there any way to trace what path the browser is actually following?
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6859942
Ok, suggestion...

I would not use target="_top" to open that page that is to wide...I would use javascript: window.open or target="_new"

When using target="_top" there is no self.opener reference available to my knowledge...when using a window.open...there is...

By the way parent.opener has the same effect..

So open that page using:

<a href="#" onclick="window.open('thebigpage.html','bigpage','width=800,height=600,scrollbars=1'); return false">Open the big page</a>

And then to get back to that frame from a link on the opened page it would be:

<a href="#" onclick="parent.opener.main.location.replace('thepagetochange.html'); return false">Return a page to the frameset</a>

Let me know if that helps...

Max.
0
 
LVL 14

Expert Comment

by:avner
ID: 6860578
Do you have a link to send us to ?
0
 

Author Comment

by:cbutton
ID: 6861960
DreamMaster, your solution didn't quite work, but using your basic idea and modifying the value of the onClick attribute in the "bigpage" to

onClick='opener.location.replace("maha.htm");return false;'

made it work, but it's not a totally satisfactory solution, because although it loads the appropriate page into the "main" frame, the user may not realize it, because "bigpage" is still on top, obscuring the "main" frame.

I don't want to unload "bigpage" but I don't want it to cover up the page that was just loaded. Any further suggestion?
0
 

Author Comment

by:cbutton
ID: 6861977
avner,
I can't send you to a link because right now these pages are only on a test server which is not on the internet.
0
 
LVL 19

Accepted Solution

by:
DreamMaster earned 200 total points
ID: 6862591
You can solve that problem by giving the opener page the focus...

Using:

onClick='opener.location.replace("maha.htm"); window.opener.focus(); return false;'

It should work like that.

Max.
0
 

Author Comment

by:cbutton
ID: 6862651
DreamMaster,
 I had solved the problem this way:

onClick='self.blur();opener.location.replace("maha.htm");return false;'

This seemed to work. At any rate, you have given me enough inormation that you should get the points. Thanks much.
0
 
LVL 19

Expert Comment

by:DreamMaster
ID: 6862660
Anytime...that's what I am here for.. :)

Thanks for the Grade A. :)

Max.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to create a table with buttons 3 33
Need output in powershell ( Vertical format) 2 34
ASP.net Markup for Sub Menu 2 46
Jquery HTML() with ajax... replacing content 2 32
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

730 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