Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frame Problems

Status
Not open for further replies.

Jimuniguy

Technical User
Mar 6, 2002
363
GB
Hi,

ProblemI have a nested frameset which when I call a file in one frame, does not put it in the other frame (even though its named correctly) puts it as a parent and hence the framset dissapears. I have included both the framset code and the left page code.

When you click on "Definitions" i want it to load into the "main" frame, not an entirely new page.

Can anyone see why its not doing this?

Cheers

Code for frameset
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

</head>

<frameset rows=&quot;50,1*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 
<frame name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize src=&quot;blank.htm&quot; marginwidth=&quot;0&quot; 

marginheight=&quot;0&quot; >

<frameset rows=&quot;1*,90&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 

<frameset cols=&quot;100,1*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;> 	
<frame name=&quot;left&quot; scrolling=&quot;NO&quot; noresize src=&quot;leftframedn.htm&quot; marginwidth=&quot;0&quot; 

marginheight=&quot;0&quot; frameborder=&quot;NO&quot; name=&quot;left&quot;>
<frame name=&quot;main&quot; src=&quot;Instructionsdn.htm&quot; marginwidth=&quot;1&quot; marginheight=&quot;1&quot; 

bordercolor=&quot;#000000&quot; scrolling=&quot;YES&quot; noresize frameborder=&quot;YES&quot; name=&quot;main&quot;>
</frameset>

<frame src=&quot;Formdn.htm&quot; scrolling=&quot;no&quot; noresize name=&quot;Form&quot;>

</frameset>
</frameset>

<noframes>
<body bgcolor=&quot;#FFFFFF&quot;>
Your Browser is incapable of Showing frames, please download a newer version
</body>
</noframes>

Code for leftframedn.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;javaScript&quot; type=&quot;text/javascript&quot; SRC=&quot;../Scripts/menu.js&quot;></SCRIPT>
<script language=&quot;javaScript&quot; type=&quot;text/javascript&quot; SRC=&quot;../pz_chromeless_2.1.js&quot;></SCRIPT>

<link rel=&quot;stylesheet&quot; href=&quot;../Scripts/Styles.css&quot;>
<style type=&quot;text/css&quot;>
</style>
</head>

<body bgcolor=&quot;#FFFFFF&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

<table width=&quot;98&quot; height=&quot;580&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td height=&quot;400&quot;><img src=&quot;../Images/Binolcula100.jpg&quot; width=&quot;100&quot; height=&quot;100&quot;><span class=&quot;leftframe&quot;><br>
&nbsp;&nbsp;&nbsp;&nbsp;-
<a href=&quot;Definitions.htm&quot; target=&quot;main&quot; scroll=&quot;no&quot;><b>Definitions<br>
</b></a>&nbsp;&nbsp;&nbsp;&nbsp;
<a href=&quot;Offline.htm&quot; target=&quot;main&quot; scroll=&quot;no&quot;>Navigation</a><a href=&quot;bpindex.htm&quot; target=&quot;main&quot; scroll=&quot;no&quot;><b>
<br>
</b></a>&nbsp;&nbsp;&nbsp;&nbsp;-
<a href=&quot;javascript:menu();&quot;><b>Main Menu</b></a><br>
&nbsp;&nbsp;&nbsp;&nbsp;-
<a href=&quot;javascript:top.close();&quot;><b>Quit</b></a>
<a href=&quot;../menu.htm&quot; target=&quot;_top&quot; scroll=&quot;no&quot;><b>
<br>
</b></a><b>
<br>
<a href=&quot;#&quot;><img src=&quot;../Images/blank2.jpg&quot; name=&quot;image1alta&quot; width=&quot;45&quot; height=&quot;41&quot; align=&quot;middle&quot; border=&quot;0&quot;></a>
</b></span></td>
</tr>
<tr>
<td height=&quot;180&quot;>&nbsp;</td>
</tr>
</table>

<span class=&quot;leftframe&quot;></span>
</body>
</html>
[/code]

 
I changed your frmaeset to:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>

</head>

<frameset rows=&quot;50,1*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame name=&quot;topFrame&quot; scrolling=&quot;NO&quot; noresize src=&quot;blank.htm&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; >

<frameset rows=&quot;1*,90&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frameset cols=&quot;100,1*&quot; frameborder=&quot;NO&quot; border=&quot;0&quot; framespacing=&quot;0&quot;>
<frame name=&quot;leftframe&quot; scrolling=&quot;NO&quot; noresize src=&quot;leftframedn.htm&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot; frameborder=&quot;NO&quot;>
<frame name=&quot;mainframe&quot; src=&quot;Instructionsdn.htm&quot; marginwidth=&quot;1&quot; marginheight=&quot;1&quot; bordercolor=&quot;#000000&quot; scrolling=&quot;YES&quot; noresize frameborder=&quot;YES&quot;>
</frameset>
<frame src=&quot;Formdn.htm&quot; scrolling=&quot;no&quot; noresize name=&quot;FormFrame&quot;>
</frameset>
</frameset>

<noframes>
<body bgcolor=&quot;#FFFFFF&quot;>
Your Browser is incapable of Showing frames, please download a newer version
</body>
</noframes>
</html>


I then changed your links for definition to in Leftframedn:

<a href=&quot;#&quot; onclick=&quot;parent.frames['mainframe'].location.href='definitions.htm'; return false&quot;><b>Definitions<br>


and it seemed to work, cant currently work out why the target property was not working, hmm???
 
You had some scroll attribute in your <a> tag I removed that and it seemed to work. sorry, Im missed it the first time, Im not sure what that scroll was meant to do. If you actually want it to scroll use the marquee tag:

<a href=&quot;definition.htm&quot; target=&quot;mainframe&quot;><marquee><b>Definitions<br></marquee></a>


otherwise just remove it and it will work fine:

<a href=&quot;definition.htm&quot; target=&quot;mainframe&quot;><b>Definitions</a><br>
 
Hi,

Cheers for that, the scroll attribute was my mistake, too much cutting and pasting!

I missed it too, as we all did in the office, silly really!

But cheers though!

James
 
Hi,

Actually it still does not work, clicking on that definitions link still does not make it work.

Any ideas why not? I have removed the scroll attribute.

Page Code
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<script language=&quot;javaScript&quot; type=&quot;text/javascript&quot; SRC=&quot;../Scripts/menu.js&quot;></SCRIPT>
<script language=&quot;javaScript&quot; type=&quot;text/javascript&quot; SRC=&quot;../pz_chromeless_2.1.js&quot;></SCRIPT>

<link rel=&quot;stylesheet&quot; href=&quot;../Scripts/Styles.css&quot;>
<style type=&quot;text/css&quot;>
</style>
</head>

<body bgcolor=&quot;#FFFFFF&quot; topmargin=&quot;0&quot; leftmargin=&quot;0&quot; marginwidth=&quot;0&quot; marginheight=&quot;0&quot;>

<table width=&quot;98&quot; height=&quot;580&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
  <tr>
    <td height=&quot;400&quot;><img src=&quot;../Images/Binolcula100.jpg&quot; width=&quot;100&quot; height=&quot;100&quot;><span class=&quot;leftframe&quot;><br>
      &nbsp;&nbsp;&nbsp;&nbsp;- 
      <a href=&quot;Definitions.htm&quot; target=&quot;main&quot;><b>Definitions<br>
      </b></a>&nbsp;&nbsp;&nbsp;&nbsp;-
      <a href=&quot;Offline.htm&quot; target=&quot;main&quot;>Navigation</a><a href=&quot;bpindex.htm&quot; target=&quot;main&quot; ><b>
      <br>
      </b></a>&nbsp;&nbsp;&nbsp;&nbsp;- 
      <a href=&quot;javascript:menu();&quot;><b>Main Menu</b></a><br>
      &nbsp;&nbsp;&nbsp;&nbsp;- 
      <a href=&quot;javascript:top.close();&quot;><b>Quit</b></a>
      <a href=&quot;../menu.htm&quot; target=&quot;_top&quot; scroll=&quot;no&quot;><b>
      <br>
      </b></a><b>
      <br>
      <a href=&quot;#&quot;><img src=&quot;../Images/blank2.jpg&quot; name=&quot;image1alta&quot; width=&quot;45&quot; height=&quot;41&quot; align=&quot;middle&quot; border=&quot;0&quot;></a>
      </b></span></td>
  </tr>
  <tr>
    <td height=&quot;180&quot;>&nbsp;</td>
  </tr>
</table>

<span class=&quot;leftframe&quot;></span>
</body>
</html>

Cheers

James
 
Hi,

P.S. I can not change the frames around.

Cheers

James
 
I changed the name of the frame main to 'mainframe' in the frameset code, did you change it back to main, im not sure if thats why, if it isnt then change your link to this:

<a href=&quot;#&quot; onclick=&quot;parent.frames[&quot;main&quot;].location.href='definitions.htm'; return false&quot;><b>Definitions<br>
</b></a>

where &quot;main&quot; is the case sensitive name of the frame where you want this link to be targeted
 
Hi,

Nah that didn't work either, but then I suddenley realised why.

I am running this thing in a &quot;chromeless window&quot;, one without even the little boxs at the top to close it, and in this script to create the chromeless window, something is calling the entire page &quot;main&quot;.

Change the frame name to anything other then main, aka &quot;timbut2&quot; and the whole things works within the chromeless window.

Sorry if I made you pull your hair out in fustration!

Cheers

Jim
 
dont worry i dont have any to pull, netscape took care of that :)

Yep, you gotta be careful choosing those names. I actually thought that may be the problem but it seemed to work when i tested it, i didnt count on there being another main on the page. Anyway well done for spotting it, they are usually quite hard to find, especially if the scripts are written by someone else!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top