js_student66
05-01-2004, 01:40 PM
I'm working on a site where i have 2 frames
when certain links are clicked, i want that page and the main page to be replaced
I took the code right out of the book i used for class, but i am finding that only the main page is begin replaced, not the links page.
I also read that you need to take out the <base target
coding, which i did (I commented out) ... but if i leave it in, both pages are replaced properly, BUT, a totally new window opens with an error.
here's my coding: (frameset)
<frameset cols="20%,*" border="0">
<frame name="leftframe" scrolling="auto" target="main" src="sidenav.htm">
<frame name="mainframe" scrolling="auto" target="main" src="welcome.htm" >
</frameset>
here is the links page that contains the javascript:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- **Remove** <base target="main"> -->
<script language="JavaScript1.2" type="text/javascript"><!--
function loadFrames(mainSrc, navSrc) {
parent.mainframe.location.replace(mainSrc);
parent.leftframe.location.replace(navSrc);
}
-->
</script>
</head>
<p><a href="javascript:void(0);"
onClick="loadFrames('background.htm','sidenav.htm')">background</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('links.htm','sidenav.htm')">Links</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('pics/picshome.htm','sidenav.htm')">Photos</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('tips.htm','sidenav.htm')">Tips</a><br>
Hope this is enough to figure out what the heck i'm doing wrong.....
(though i'm contemplating chuckin' the whole thing and using tables - which i dont like, but will do the trick)
Thanks in advance,
Terese
when certain links are clicked, i want that page and the main page to be replaced
I took the code right out of the book i used for class, but i am finding that only the main page is begin replaced, not the links page.
I also read that you need to take out the <base target
coding, which i did (I commented out) ... but if i leave it in, both pages are replaced properly, BUT, a totally new window opens with an error.
here's my coding: (frameset)
<frameset cols="20%,*" border="0">
<frame name="leftframe" scrolling="auto" target="main" src="sidenav.htm">
<frame name="mainframe" scrolling="auto" target="main" src="welcome.htm" >
</frameset>
here is the links page that contains the javascript:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- **Remove** <base target="main"> -->
<script language="JavaScript1.2" type="text/javascript"><!--
function loadFrames(mainSrc, navSrc) {
parent.mainframe.location.replace(mainSrc);
parent.leftframe.location.replace(navSrc);
}
-->
</script>
</head>
<p><a href="javascript:void(0);"
onClick="loadFrames('background.htm','sidenav.htm')">background</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('links.htm','sidenav.htm')">Links</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('pics/picshome.htm','sidenav.htm')">Photos</a><br>
<a href="javascript: void(0);"
onClick="loadFrames('tips.htm','sidenav.htm')">Tips</a><br>
Hope this is enough to figure out what the heck i'm doing wrong.....
(though i'm contemplating chuckin' the whole thing and using tables - which i dont like, but will do the trick)
Thanks in advance,
Terese