View Full Version : changing frame content from another page
paolaban
11-16-2002, 08:43 AM
I have a simple html page: home.html. Here there are 5 links, all they link to frame.html, a page with a frameset and 4 frame. 2 named frame(intestazione and centrale) have to change depending whitch link i press in home.html.
I'm trying in this way:
home.html:
<head>
<script language="JavaScript">
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="frame.html" onClick="toped('intestazione-libri.html','libri.html')">
Thanks so much for your kindnesss
See if this is any good.
If you have your home page in a single window then a new window has to be opened for the frameset, otherwise you will lose access to the other links in your home page.
<script language="JavaScript">
<!--
function init(testa, corpo){
Testa=testa
Corpo=corpo
setTimeout("toped(Testa, Corpo) ",500)
}
function toped(testa, corpo) {
newwin.focus()
var tested = testa
var corped = corpo
newwin.parent.intestazione.location.href= tested
newwin.parent.centrale.location.href= corped
}
// -->
</script>
<a href="#null" onClick="newwin=window.open('frame.html','mywin')" onmousedown="init('intestazione-libri.html','libri.html')"> Link 1</a>
<P><a href="#null" onClick="newwin=window.open('frame.html','mywin')" onmousedown="init('intestazione-libri.html','libri.html')"> Link 2</a>
paolaban
11-16-2002, 05:17 PM
so you tell me to open a new window with a timer and use the new window to make a path that target the frame...
Do you think is not possible to target the frame without the window?
Well.. i will try...
Just a questin. When i open the new window, i have a link that bringme to home.html. So i would like that the page simply close itself... just using a function windowClose?
paolaban
11-16-2002, 05:24 PM
i try in your way and i feel i'm quite close to the final solution!
But the problem is that the new url are loaded in the right frames... when i use the browser arrow to back, it display me the frame page with the old url... maybe i have to put variabiles also inside the frame src?
You cannot target a frame if it does not exist
you could try replace() method so that the pagfes don't go in the history
paolaban
11-17-2002, 10:39 AM
"you could try replace() method so that the pagfes don't go in the history"
Sorry, but i'm so bad in js... what do you mean exactly?
I try putting in the two frame a no file src... i don't know if it is right but it seems to work.
In the frame.html and exactly in the frame "centrale" and "intestazione" I wrote <frame src="#"...>
Dreamweaver alert me with "# is a file that it doesn't exist".
But when i pressa link the browser back button is inactive...
What do you thinck?
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.