Loading 2 pages

admin

Administrator
Staff member
I have posted the problem before, but I have not yet found the sollution... Maybe another way to solve this problem.<br />
I have an html page with 3 frames. a top, menu and main frame. When I click on link in the menu I want the top and the main frame to change. Now, I have tried some scripts, but none have worked so far.<br />
I have been thinking it might be a good idea to just let one frame load and make the other page load automaticly when opening the top frame... (you still with me?)<br />
Well, if you think you can help me out, please do so... I am going slightly mad...:splat: <br />
<br />
Grtz,<br />
DJ Diaper<!--content-->What I would do is have the link target the main frame and use java to make a redirect that targets the top frame. Im not sure if and/or how this could be done. Let me try to work something up. Im still kinda new to writing java so I cant promise anything. }:-)<!--content-->Thanx in advance for the trouble :wave: <br />
It is really appreciated!<!--content-->according to this you already have the code<br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25421">http://www.htmlforums.com/showthread.ph ... adid=25421</a><!-- m --><!--content-->Originally posted by scoutt <br />
according to this you already have the code<br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=25421">http://www.htmlforums.com/showthread.ph ... adid=25421</a><!-- m --> <br />
I know Scoutt, but the strange thing is... It won't work. So I was just wondering on how to load a page when the first opens... That seemed like a fine sollution as wel :D<!--content-->what doesn't work about it? it works fine for me.<!--content-->Ok Scoutt, here I go<br />
<br />
<SCRIPT language="JavaScript"><br />
<!--Hide<br />
Function change2(top,main)<br />
{<br />
parent.top.location.href=http://www.htmlforums.com/archive/index.php/top;<br />
parent.main.location.main=main;<br />
}<br />
//--><br />
</SCRIPT> <br />
<br />
This is my script so far in the head.<br />
<br />
The body looks like this...<br />
<a href=http://www.htmlforums.com/archive/index.php/"java script:change2(top/top2.html,util.html)" <img SRC="menu/02But_dn.gif" ALT="Utiliteitsbouw" NAME="b" hspace="15" BORDER=0></a> <br />
<br />
It also contains some rollover java, but i left that stuff out... It loads an error in the menu frame... I am losing it here :confused:<!--content-->Try this, it might be the same as the method in the other thread but it worked for me:<br />
<br />
Create a function like this for each button you want:<br />
<br />
function button1()<br />
{<br />
parent.framename1.location="page1.htm";<br />
parent.framename2.location="page2.htm";<br />
}<br />
<br />
Change "framename1" and "framename2" with the names of the 2 frames and use the onClick() function with an <a href> tag.<br />
<br />
<br />
<br />
Hope it helped!<!--content-->Originally posted by DJDiaper <br />
It also contains some rollover java, but i left that stuff out... It loads an error in the menu frame... I am losing it here :confused: Did you try to strip the whole rollover code for the button? Perhaps the scripts are giving conflicts and thats why the function doesn't work.<br />
<br />
Post the whole script ...<!--content-->Originally posted by DJDiaper <br />
Ok Scoutt, here I go<br />
<br />
<SCRIPT language="JavaScript"><br />
<!--Hide<br />
Function change2(top,main)<br />
{<br />
parent.top.location.href=http://www.htmlforums.com/archive/index.php/top;<br />
parent.main.location.main=main;<br />
}<br />
//--><br />
</SCRIPT> <br />
<br />
This is my script so far in the head.<br />
<br />
The body looks like this...<br />
<a href=http://www.htmlforums.com/archive/index.php/"java script:change2(top/top2.html,util.html)" <img SRC="menu/02But_dn.gif" ALT="Utiliteitsbouw" NAME="b" hspace="15" BORDER=0></a> <br />
<br />
It also contains some rollover java, but i left that stuff out... It loads an error in the menu frame... I am losing it here :confused: <br />
wel there is your problem. you have variables the same name as your frame names.<br />
<br />
<SCRIPT language="JavaScript"><br />
<!--Hide<br />
Function change2(top,main)<br />
{<br />
parent.top.location.href=http://www.htmlforums.com/archive/index.php/top;<br />
parent.main.location.main=main;<br />
}<br />
//--><br />
</SCRIPT> <br />
<br />
you have to keep them seperate. either rename the variables to something else or rename your frame names.<!--content-->
 
Back
Top