anchors, links, frames

hi everyone:

i am using frames on couple of pages of my website. now, if i try to link to a section (anchor) of one of the pages that is part of the frameset, it always goes to the top of the page. this is what i mean:

my files look like this:

frameset1.htm
untitledFrame-1.htm
untitledFrame-2.htm
untitledFrame-3.htm

as you can see, frameset1.htm controls the positioning and so on of the untitledFrame-1.htm, untitledFrame-2.htm, and untitledFrame-3.htm pages. these are three sections one next to the other one. i am interested in creating an anchor in one of the pages, let say on untitledFrame-2.htm. now i need to link to that section by somehow calling href=frameset1.htm (to keep all the sections together) but at the same time to the anchor on untitledFrame-2.htm

is that clear ???

thanks.
chrome2000Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

knightEknightCommented:
actually, that isn't to clear :)  but if I can guess this -- you want a single click to simultaneously change the position of all three framed pages, correct?

<A href="#" onclick="top.frame1.location='#anchor1';top.frame2.location='#anchor2';top.frame3.location='#anchor3';return false;"> click </a>
0
knightEknightCommented:
and in each of the three pages you have anchors like this:

  content
  <A name="anchor1"></a>
  content
0
knightEknightCommented:
hmm, you may have to specify the entire page name -- i'm not sure:

    ...  top.frame1.location='untitledFrame-1.htm#anchor1';  ...
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

knightEknightCommented:
also, the code above assumes your frames are named "frame1","frame2","frame3"
0
knightEknightCommented:
oh!  now I re-read your Q and I think i got it ...

You can do this in your link to the frameset page:

<A href="frameset1.htm?anchor2" > open frameset </a>

then in the frameset page, do this:

<FRAMESET>
  <FRAME name="frame1" src="untitledFrame-1.htm" > 
  <FRAME name="frame2" >
  <FRAME name="frame3" src="untitledFrame-3.htm" >
</FRAMSET>

<SCRIPT language="javascript">
   top.frames["frame2"].location = "untitledFrame-2.htm#" + location.search.substring(1);
</SCRIPT>
0
knightEknightCommented:
... and in untitledFrame-2.htm you have an anchor:

  content
  <A name="anchor2"></a>
  content

0
chrome2000Author Commented:
hold on my man, i have to digest this slowly
0
knightEknightCommented:
ok ... this worked for me ... here is the frameset page:

<HTML>

<SCRIPT language="javascript">
 function onLoadHandler()
 {
   var f2url = "untitledFrame-2.htm#" + location.search.substring(1);
   alert(f2url);
   top.frames["frame2"].location = f2url;
 }
</SCRIPT>

<FRAMESET rows="80,80,*" onload="onLoadHandler();">
  <FRAME name="frame1" src="untitledFrame-1.htm" > 
  <FRAME name="frame2" >
  <FRAME name="frame3" src="untitledFrame-3.htm" >
</FRAMSET>

</HTML>
0
knightEknightCommented:
remove the alert, ofcourse.


Here is the link I used to open the above frameset page:

  <A href="frameset1.htm?anchor2" > open frameset </a>



and here is the frame2 page:

 <html>
 <body>
 <p> content </p>
 <p> content </p>
 <p> content </p>

  <A name="anchor2"></a>

 <p> content </p>
 <p> content </p>
 <p> content </p>
 </body>
 </html>
0
chrome2000Author Commented:
hi knightEknight:

that did not work

here is how my code looks on the frameset page i hope you can copy it and paste it so you can see it more clear :)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

top.frames["centreFrame"].location = "UntitledFrame-15.htm#" + location.search.substring(1);


MM_reloadPage(true);
//-->
</script>
</head>
<frameset cols="153,*" frameborder="NO" border="0" framespacing="0">
  <frame src="UntitledFrame-2.htm" name="leftFrame" scrolling="NO" noresize>
  <frameset rows="*" cols="1,*" framespacing="0" frameborder="NO" border="0">
    <frame src="UntitledFrame-3.htm" name="leftFrame1" scrolling="NO" noresize>
    <frameset rows="*" cols="750,110" framespacing="0" frameborder="NO" border="0">
      <frameset rows="*" cols="*,1" framespacing="0" frameborder="NO" border="0">
        <frameset rows="54,*" cols="*" framespacing="0" frameborder="NO" border="0">
          <frame src="UntitledFrame-6.htm" name="topFrame" scrolling="NO" noresize >
          <frameset rows="1,*" cols="*" framespacing="0" frameborder="NO" border="0">
            <frame src="UntitledFrame-7.htm" name="topFrame1" scrolling="NO" noresize >
            <frameset rows="10,*" cols="*" framespacing="0" frameborder="NO" border="0">
              <frame src="UntitledFrame-8.htm" name="topFrame2" scrolling="NO" noresize >
              <frameset rows="1,*" cols="*" framespacing="0" frameborder="NO" border="0">
                <frame src="UntitledFrame-9.htm" name="topFrame3" scrolling="NO" noresize >
                <frameset rows="21,*" cols="*" framespacing="0" frameborder="NO" border="0">
                  <frame src="UntitledFrame-10.htm" name="topFrame4" scrolling="NO" noresize >
                  <frameset rows="1,*" cols="*" framespacing="0" frameborder="NO" border="0">
                    <frame src="UntitledFrame-11.htm" name="topFrame5" scrolling="NO" noresize >
                    <frameset rows="10,*" cols="*" framespacing="0" frameborder="NO" border="0">
                      <frame src="UntitledFrame-12.htm" name="topFrame6" scrolling="NO" noresize >
                      <frameset rows="1,*" cols="*" framespacing="0" frameborder="NO" border="0">
                        <frame src="UntitledFrame-13.htm" name="topFrame7" scrolling="NO" noresize >
                        <frameset rows="10,*" cols="*" framespacing="0" frameborder="NO" border="0">
                          <frame src="UntitledFrame-14.htm" name="topFrame8" scrolling="NO" noresize >
                          <frame name="centreFrame" >
                        </frameset>
                      </frameset>
                    </frameset>
                  </frameset>
                </frameset>
              </frameset>
            </frameset>
          </frameset>
        </frameset>
        <frame src="UntitledFrame-5.htm" name="rightFrame1" scrolling="NO" noresize>
      </frameset>
      <frame src="UntitledFrame-4.htm" name="rightFrame" scrolling="NO" noresize>
    </frameset>
  </frameset>
</frameset>
<noframes><body>

</body></noframes>
</html>

here is the section where i link the picture to the section that i want to load:

<tr>
      <td><a href="applications/applicationss.html?pharmaceuticals" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image78','','../../images/graphics/applications/general_dark.png',1)"><img src="../../images/graphics/applications/general_light.png" name="Image78" width="250" height="20" border="0"></a></td>
   
 </tr>

here is my anchor in the page

<td width="35%" bordercolor="#666666" bgcolor="#D6D6C0" > <div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong><a name="pharmaceuticals"></a>Pharmaceuticals</strong></font></div></td>

sorry but i tried different things and i get this error

Not Found
The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. Please inform the site administrator of the referring page./

thank you for your help

rene
0
chrome2000Author Commented:
let my try what you wrote in your last couple of comments
0
chrome2000Author Commented:
hi knightEknight:

still does not work. i think that the problem is on the script:

function onLoadHandler()
{
   var f2url = "UntitledFrame-15.htm" ;
   alert(f2url);
   top.frames["centreFrame"].location = f2url;
}

it shows the correct link on the alert(f2url) but when it tries to load the frame on the frameset it gives me this error:

Not Found
The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. Please inform the site administrator of the referring page.f

i think that the problem is here:

top.frames["centreFrame"].location = f2url;

by the way both the frameset and each of the frames (pages), are in the same folder  ????

any ideas ??

thanks
0
knightEknightCommented:
you will have to adjust for the number and level (heirarchy) of frames that you have.
0
chrome2000Author Commented:
that is what i thought but if i just write it has it is, it means that i am at root ??

this is how my files and folders look

index.html       (0)
pages folder    (0)
-->main pages folder  (1)
---->applications folder (2)
------>frameset.htm         (3)
------>untitledframe.htm   (3)
------>untitledframe2.htm   (3)
------>untitledframe3.htm   (3)

even better:

-what does this do ??

top.frames["centreFrame"].location = f2url;

-i would rather understand what each thing do in this line

-should something like this do the trick ???

var f2url = "../../../UntitledFrame-15.htm" ;


thank you very much
0
knightEknightCommented:
each set of frames is an array, and if you have nested frames then there are arrays within arrays -- and you have as many as I have ever seen.  Without going thru all of them, I can tell you that the topmost frame is called "top" and after that you will have to drill down something like this:

  top.leftFrame.leftFrame1.topFrame.topFrame1.topFrame2 ... topFrameN.centreFrame.location = f2url;
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
chrome2000Author Commented:
hi knightEknight:

i see what you mean, the only problem is that i have never play with this kind of code

top.leftFrame.leftFrame1.topFrame.topFrame1.topFrame2 ... topFrameN.centreFrame.location = f2url;

can you tell me how it works ?

thank you very much
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.