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?


LVL 3
rfr1tzAsked:
Who is Participating?
 
COBOLdinosaurConnect With a Mentor Commented:
I think:
opener.top.frames['bottom'].location.href="theurl.html";

Cd&
0
 
ZylochCommented:
Hi rfr1tz,

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

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

Regards...
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.