Solved

Linking into a frame

Posted on 2002-03-12
14
168 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
 
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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now