Solved

Linking into a frame

Posted on 2002-03-12
14
174 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

 
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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
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 …

687 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