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

open a frame page from a simple html page, with determinate target...

Status
Not open for further replies.

paola13

Technical User
Oct 22, 2001
36
IT
I have my home.html with 5 links inside. Each links are target to frame.html. If i press the link number one, i would like that in the frame.html it is loaded determinate pages in the frames...
For example frame name="top"... here i have to load top1.html
frame name="center"... here center1.html...
 
If I understand you correctly, you want to change the pages displayed in the frames to PAGE_NAME_1.html for link one, PAGE_NAME_2.html for 2, etc., right? If so, just link to a new page with a frameset in it. You may have to add to the link: target="top"

Rick
 
I thought to make 5 frame pages for each links... but i would like to do this with just the same frame page.
I know it is possible in js..

I'm trying in this way:
Making a function like this:
<script language=&quot;JavaScript&quot;>
function toped(testa, corpo) {

var tested = testa
var corped = corpo
parent.intestazione.location= tested
parent.centrale.location= corped

}
</script>

and then, in the link....
<a href=&quot;frame.html&quot; onClick=&quot;toped('intestazione-libri.html','libri.html')&quot;>

testa and corpo are the pagesto put in the frame target intestazione and centrale. Frame.htm is the main page with the frame set...
But it doesn't works

PS sorry my english is so bad :)
 
Hi again,
You were close. Try this instead:
parent.intestazione.location.href= tested
parent.centrale.location.href= corped

Rick

P.S. Don't worry. I'm always talking to people who speak english much worse;-).
 
i put href in the var definitions... but nothing happends!
maybe because of the name frame in the frameset. Infact, in the frame i load other pages and just this are display, evenif i put the function..
Maybe i have to put the variabiles also inside the frame?
For example:
<frame src=&quot;tested&quot; name=&quot;intestazione&quot; scrolling=&quot;NO&quot; noresize>.... thanks for your marcy for my english!
 
Well.. the site is not online. I post here the code inside home.html:
<head>
<script language=&quot;JavaScript&quot;>
function toped(testa, corpo) {

var tested = testa
var corped = corpo
parent.intestazione.location.href= tested
parent.centrale.location.href= corped

}
</script>

and in the button:
<a href=&quot;frame.html&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('poesia','','images/poesia-g.gif',1)&quot; onClick=&quot;toped('intestazione-libri.html','libri.html')&quot;>
Thanks so much for your kindnesss


</head>
 
Try changing the href part to this:

<head>
<script language=&quot;JavaScript&quot;>
function toped(testa, corpo) {

var tested = testa
var corped = corpo
parent.intestazione.location.href= tested
parent.centrale.location.href= corped

}
</script>
</head>

<a href=&quot;#&quot; onMouseOut=&quot;MM_swapImgRestore()&quot; onMouseOver=&quot;MM_swapImage('poesia','','images/poesia-g.gif',1)&quot; onClick=&quot;toped('intestazione-libri.html','libri.html')&quot;>
Thanks so much for your kindness

This probably won't fix things, but it might. If it doesn't, please post the frameset part, too.

Rick
P.S. Where are you from?
 
sorry Ristmo... i went out for a stroll beside of the venice lagoon! I'm from Venice ;)
Now i try your script and tell you!
And you? Because of your nick name i' think you are from Germany.. or not?
 
ok... here I am!
I tryed to put # instead of frame.html but nothing happends!
But in the browser page is written: error in display page. When i click on this it tells me that parent.intestazione.location.href= tested is not an object...
I know i'm like an annoying moschito! :)
 
Ok. Put the frame.html back in how it used to be. I forgot that you needed to also change the url of the page the link is in. Try this for the script:
window.document.parent.intestazione.location.href= tested
window.document.parent.centrale.location.href= corped

Rick
P.S.
Actually, I'm an American living overseas in Jordan. I got my name by taking the first 2 letters of my 3 names and combining them:
Richard Stephen Mogan.

Clever, ain't I? ;-)
 
when you say Jordan you meen Middle East or the caucasian country?
about my topic... i tried yesterday with window.document... but it doesnt' work.
I think the problem is on the frame. The PC dosen't recognize the frame name, maybe because we have to put var also here...
I am ignorant about javascript, just use some scripts done and manage them...
I post in six different forums: Italy, England, Germany and Danmark, but nobody help me Snif.
You are the only one.... Tooo much kind!

PS Wich part of USA do you came from? Do you know Venice?
 
I haven't used frames for over a year, so I don't remember everything about them, but I think that this should work fine. You can try this, but if that didn't work, I don't think this will, either:
window.document.top.intestazione.location.href=tested;

If that doesn't work I'd recommend either making a new page with a frameset or (better, in my opinion) getting rid of the frames and using tables. I'm going to bed now (it's after 10:30 here) but I will try to work on it some more tomorrow if you really want to do it.

Yes, I know Venice, Italy. I'm really from all over! I was born in Pennsylvania, lived for a while in California, Texas, & Korea, then moved to Washington and Oregon. I lived there for a long time. I only moved to Jordan (yes, Middle East) about 3.5 years ago.

Rick
P.S. to test the frame name, do this:
<a href=&quot;frame.html&quot; target=&quot;centrale&quot;>Click Here</a>
If that works, then the name is fine, otherwise, it must be changed.
 
thanks Rick for your help!
Here is 21:40, one hour less! I will try this night (if i stand) or tomrrow morning... then post here. Thanks a lot never tired to say thank you :)
Hey! yOU TRAVEL ALOT... ups capslok!
Must be hard for an american to work in middle east now...
Never been in California, but my dream is to go there. It is springtime all the year! I can't imagine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top