?
Solved

Linking into a frame

Posted on 2002-03-12
14
Medium Priority
?
177 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
Technology Partners: 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 800 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

850 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