Link to home
Start Free TrialLog in
Avatar of clau
clau

asked on

No frames to frames

Maybe this is too simple or maybe it can't be done. I have a no frames home page with links A,B,C. I want to open this links in a frame page that will have a header frame with the same links and a content frame. I want link A to open the frame page with page A in the content frame, link B to open page B, etc. Thank you
Avatar of andriv
andriv

The links should be like this from the main page.

<A HREF="frame.html?A.htm">A</A>
<A HREF="frame.html?B.htm">B</A>
<A HREF="frame.html?C.htm">A</A>

Create a blank page and name it blank.html
Create the navigation html (nav.html)
then Create the frame page like this:

<html>
<head>
<Title>ABC</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
 <!--
 function loadmain() {
 var strURL = window.location.search;
if (strURL) {
 strURL = strURL.substring(1,strURL.length);
 window.frames['main'].location = strURL;
 }
 }
//-->
</SCRIPT>
</head>
      <frameset rows="120,*" frameborder="0" border="no" framespacing="0" noresize scrolling="no" marinwidth="0">
            <frame src="nav.html" name="top" scrolling="no" NORESIZE>
                                 <FRAME SRC="blank.html" NAME="main" FRAMEBORDER="1" SCROLLING="Auto">
      </frameset>
<NOFRAMES><BODY>

                      Your browser needs frame support!

                      </BODY></NOFRAMES>
</html>
Avatar of clau

ASKER

Sorry andriv, it didn´t work.
Let´s see if I got it right:
I created a page called "abc.htm" where I put the code. I created "blank.html", "nav.html" with links to A, B, C.
 Then I created "princ.htm" where I wrote:
<a HREF="abc.htm?A.htm">A</a> <a HREF="abc.htm?B.htm">B</a> <a HREF="abc.htm?C.htm">C</a>
The¨"abc.htm" works well alone, but when called from "princ" it displays "blank.htm"
Almost, you must create the frame. My example below the frame is called frame.html

<html>
<head>
<Title>DBT Local Directory</title>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
 <!--
 function loadmain() {
 var strURL = window.location.search;
if (strURL) {
 strURL = strURL.substring(1,strURL.length);
 window.frames['main'].location = strURL;
 }
 }
//-->
</SCRIPT>
</head>
      <frameset rows="120,*" frameborder="0" border="no" framespacing="0" noresize scrolling="no" marinwidth="0">
            <frame src="logo.html" name="top" scrolling="no" NORESIZE>
                                 <FRAME SRC="blank.html" NAME="main" FRAMEBORDER="1" SCROLLING="Auto">
      </frameset>
<NOFRAMES><BODY>

                      Your browser needs frame support!

                      </BODY></NOFRAMES>
</html


 then the <a href> tag from the main page should be directed to the frame followed by a ? followed by the page you wish the main to be. (the bottom frame)

<a HREF="frame.htm?abc.htm">A</a>

the above link, if on your main page would first open the frame page and put the abc.htm in the bottom frame where the frame directs it to be.
Avatar of clau

ASKER

No, it doesn´t work. Shouldn´t I call the function from anywhere within the document?
Why don't you past the exact code for each page with the name for each so I can take a look at it.  I use the exact code for one of my sites.  (www.dbt-local.com).
Avatar of clau

ASKER

Thanks for your help!
I´ve entered your site and I see it works allright there.
I´ve put my code in
http://www.clic.com.ar/pruebas
Will you take a look at it?
Thanks again!
There is more then one thing wrong.  On your ahref tags you have frame.html?A.htm.  The web is case sensative so since your page is named a.htm you would have to write is a such.
<ahref="frame.html?a.htm> and the same for the other two.

The other problem is in your frame.html.  I can not view it from the browser so you have to copy and paste it here so I can take a look.
Ok, I see your frame script.  I did not know I was able to veiw throught the browser.  I believe your problem is you closed the body before the noframe. It should be:

</noframe>
</body>

You have it the oppisite.
No the code you have is correct. The only differance between yours and mine is the order of the frame attributes try writting it in the exact order as mine as see if it makes a differance.

<frameset rows="120,*" frameborder="0" border="no" framespacing="0" noresize scrolling="no" marinwidth="0">
<frame src="logo.html" name="top" scrolling="no" NORESIZE>
<FRAME SRC="blank.html" NAME="main" FRAMEBORDER="1" SCROLLING="Auto">
ASKER CERTIFIED SOLUTION
Avatar of andriv
andriv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of clau

ASKER

Great!!! I ONLY had to change it and it worked
Tons of thanks again!