• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

can't write into frame

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
rfr1tz
Asked:
rfr1tz
1 Solution
 
ZylochCommented:
Hi rfr1tz,

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

Regards,
Zyloch
0
 
COBOLdinosaurCommented:
I think:
opener.top.frames['bottom'].location.href="theurl.html";

Cd&
0
 
ZylochCommented:
Oops, that's my bad. Cd, you're right ;)

Regards...
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!

 
COBOLdinosaurCommented:
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
 
rfr1tzAuthor Commented:
Good point Dino. But actually I didn't name it 'bottom' - that was just for illustration.
0
 
arantiusCommented:
Actually the reserved name is _top, with the underscore, is it not ?
0
 
ZylochCommented:
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

Independent Software Vendors: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now