Solved

can't write into frame

Posted on 2004-10-03
9
148 Views
Last Modified: 2010-07-27
I open a web page containing two frames - the frame  names are "top" and "bottom".

From the page in the "top" frame, I open a new dialog (using javascript window.open). The user clicks on a button in that  dialog, and I want to open a page in the "bottom" frame of the original window.

I've tried my usual  -  parent.frames['bottom'].document.location = "the url I want to display in the frame".

But this didn't work.


Maybe window.open creates another parent?

In any case, can anyone tell me how to aim a URL at that bottom frame?


0
Comment
Question by:rfr1tz
9 Comments
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Hi rfr1tz,

Yes, you would do parent.parent.frames['bottom'].location.href="theurl.html";

Regards,
Zyloch
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 250 total points
Comment Utility
I think:
opener.top.frames['bottom'].location.href="theurl.html";

Cd&
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
Oops, that's my bad. Cd, you're right ;)

Regards...
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 53

Expert Comment

by:COBOLdinosaur
Comment Utility
And if that fails it is because you have named your frame using the reserved property name top.  Probably a good idea to change it no matter what you do, because sooner or later it will jump up and bite you.

Cd&
0
 
LVL 3

Author Comment

by:rfr1tz
Comment Utility
Good point Dino. But actually I didn't name it 'bottom' - that was just for illustration.
0
 
LVL 18

Expert Comment

by:arantius
Comment Utility
Actually the reserved name is _top, with the underscore, is it not ?
0
 
LVL 36

Expert Comment

by:Zyloch
Comment Utility
It seems to be like that in links, like _self, for example, but if look at any frame breaking code in Javascript:

top.location=self.location

Apparently, in Javascript, you take away the underscore. In any case, Cd's frames[] array part should fix it fine and dandy
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

744 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

15 Experts available now in Live!

Get 1:1 Help Now