hyperlinks to a framed page

liunx

Guest
Hi, <br />
<br />
i have a page without frame with 5 different hyperlinks. Each of these hyperlinks directs to a page with frames. These pages use all the same pattern of frames. So when i click on one link I want my new page to be loaded with its 5 frames. For all links two of these frames are the same, and three others are specific to the link.<br />
<br />
I know i could make 5 new html files which specifies what to put in each of the frames, but i would like to have one generic file to do that.<br />
<br />
Is it possible?<br />
Jo<!--content-->boy you lost me. if you have links tha tgoto a framed page then you use this<br />
<br />
<a href=http://www.htmlforums.com/archive/index.php/"page.html" target="Frame_name"><br />
<br />
change the Frame_name to the name of the frame you want it to go to.<br />
<br />
ifyou want to use 1 file for all 5 pages then you should use serverside language and make the pagename go in the url.<br />
<br />
like page.html?page=1 or page.html?page=2<br />
<br />
as that would open up page1 and page2 respectively if you had code to check which page equaled 2<!--content-->Suppose i use<br />
<a href=http://www.htmlforums.com/archive/index.php/"page.html" target="Frame_name"><br />
then it would put page.html into the targeted frame, but since the page where that link lies does not know the target specified (because it is a frame from another file)that won't work, right?<br />
<br />
<br />
:confused: :confused: :confused:<!--content-->is the framed pages all on the same site?<!--content-->yes they are... but not all the pages use the same pattern of frames<!--content-->well then, you have your work cut out for you. you will need to use some javascript that will detect what page the user clicked on and load the respective frame. my suggestion is that you stick with one index and your life will be much easier.<br />
<br />
let me look if I have something like that. if not I am sure soembody will come along and do it for you.<!--content-->ok I found it.<br />
<br />
this is mainly for php but youshould be able to use it for what ever.<br />
<br />
<br />
<script> <br />
function FullScreen_go(){ <br />
if (top.location == location) { <br />
top.location.href = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"frames.php?location=" + location; <br />
} <br />
} <br />
</script><br />
<br />
<br />
Then a frames.php page: (but could be named anything)<br />
<FRAMESET ROWS="*,*" border=0> <br />
<FRAME NAME="Top" SRC=http://www.htmlforums.com/archive/index.php/"yourframe.htm"><br />
<FRAME NAME="Main" SRC=http://www.htmlforums.com/archive/index.php/"<?print $location; ?>" ><br />
</FRAMESET><!--content-->Ok i pass a variable location to tell frames.php which frame to load. Good.<br />
<br />
And you load the framed page with this: <br />
top.location.href = <!-- m --><a class="postlink" href="http://www.htmlforums.com/archive/index.php/">http://www.htmlforums.com/archive/index.php/</a><!-- m -->"frames.php?location=" + location; <br />
Very good.<br />
<br />
But i dont understand the line where i check if top.location == location <br />
isn't top.location the current page? If it is the current page (not framed) then it won't be equivalent to 'location' (framed page)...<br />
<br />
also when i call the function shouldn't I pass the variable location with it: FullScreen_go(location)?<br />
<br />
<br />
jo<!--content-->
 
Back
Top