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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loading page in a frame of another window. 1

Status
Not open for further replies.

soonkhoo

Programmer
Dec 8, 2000
133
MY
Hi, I have a windowA with links to load in windowB. BUT..
what if windowB is a frameset? For example, topFrame and mainFrame, and I want to load the links only in the mainFrame...

currently, in windowA, I have links something like this...

<a href=&quot;SOMETHING.htm&quot; target=&quot;windowB&quot;>Blahblah</a>

what should I add in?

Thanks
Soon
 
Oh...actually, what if in windowA, I want to have a link to load the topFrame with page1 and along with the click, the mainFrame loads page2?

Soon
 
Here it is:

Add this script to <HEAD> section:

function loadAll() {
parent.frame1.location.href= &quot;first.htm&quot;;
parent.frame2.location.href= &quot;second.htm&quot;;
}

Add this to navigation frame:

<a href=&quot;javascript:loadAll()&quot;>first and second</a>

Dont forget to change &quot;frame1&quot; and &quot;frame2&quot; to your frame names.

Andrew
 
that is exactly what I did...but it didn't work. Is it because parent is only use for within a FRAMESET and will ignore other framesets? I tried self.frame1.location......
and it still didn't work. I also tried the same way you coded it but at the link,
<a href=&quot;javacascript:loadAll()&quot; target=&quot;windowB&quot;>something</a> and it still didn't work...hmmm

Soon
 
+----+----+
| A | |
+----+ C |
| B | |
+----+----+
ok, say A and B are INSIDE a frameset (call it A_B)
and C and A_B are inside another frameset (the top level of the page)

now, try to think logical :
from top level, you &quot;see&quot; C and A_B
from C and A_B you see top level
from A_B you see A and B
from A and B you see A_B

so, you're in A and want to adress C : first find A_B then top level then C :
top.top.C is enough !!!!!! (top accesses A_B, top.top accesses top level and from top level you &quot;see&quot; C)

you can use the &quot;parent&quot; keyword but it sounds like you really need to understand frames first

and btw, why do you use 2 frame levels ??? !!!!!!!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top