Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 windows, 1 window loads the 2nd. Possible? 2

Status
Not open for further replies.

soonkhoo

Programmer
Dec 8, 2000
133
MY
Hi all,

I have 2 windows opened. Window A and B. In Window B, I have a link to load pages but I don't want it to load in B. How can I pass the message to Window A such that it loads in Window A?
Thanks.

Soon
 
how would it recognize that it's Window A that should be loading and not Window C... Also, what if Window A is a frameset and that you want to load in the mainFrame.

Soon
 
or you could also use opener.windowname to indentify the windows
 
Ok, it's a little bit tricky for me to post the code as both of the windows have individual frames. But I'll try to explain exactly what I need.

I have Browser opened. There's a button to open a window, that is Window A. In window A, it has a button to open window B. This is not the problem. Just letting you understand that there's 1 browser and 2 windows opened now.

In Window B, there is a link, say, Yahoo.com. But I don't want that page to load in window B but instead, it should load in window A.

What I did is,

<html>
<head>
<script>
function loadpage(){
something here... <---what should I put in here?
}

</head>
<body>

<a href=&quot;javascript:loadpage();&quot;>YAHOO</a>
</body>
</html>

 
That's the part of that I don't know. How do you assign a name for the windowA if it is a frameset with 2 frames? topFrame and content.

Soon
 
I didn't load anything to my windowA. Perhaps I don't know where to get the name from the WindowA. Do I need to assign a name for windowA? If so, is it in the Meta tag name=&quot;windowA&quot; ?


Soon
 
When you create new windows, tag them on to a variable. Though the second argument in the open function is the name, I am thinking that is used purely for the target attribute in a link - so here where nitinkhanna said:

opener.WindowA...

this mplies you created that window like:

var windowA = open('','someName',attributes);

So the short answere is Yes, assign it to a variable. BB &quot;Alright whatever man, I'll hook up the hair, but I aint touchin the ring...Cause I'm still a pla--yer&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top