[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

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
0
clau
Asked:
clau
  • 7
  • 4
1 Solution
 
andrivCommented:
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>
0
 
clauAuthor Commented:
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"
0
 
andrivCommented:
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.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
clauAuthor Commented:
No, it doesn´t work. Shouldn´t I call the function from anywhere within the document?
0
 
andrivCommented:
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).
0
 
clauAuthor Commented:
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!
0
 
andrivCommented:
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.
0
 
andrivCommented:
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.
0
 
andrivCommented:
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">
0
 
andrivCommented:
Finally!!! I found Your problem on the blank.html the body tag should look like this.

<BODY onLoad="parent.loadmain()">
0
 
clauAuthor Commented:
Great!!! I ONLY had to change it and it worked
Tons of thanks again!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now