Solved

Linking into a frame

Posted on 2002-03-12
14
170 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spacing 5 57
Bootstap Icons 3 45
Synchronizing CSS load 3 30
AngularJS Page Control Understanding 5 40
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 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

22 Experts available now in Live!

Get 1:1 Help Now