Web Analytics Made Easy -
StatCounter loading page inside frameset using location.href - CodingForum

loading page inside frameset using location.href

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • jennifer1980
    New to the CF scene
    • Feb 2004
    • 1

    loading page inside frameset using location.href

    Hi! OK I have the problem which is probbaly easy to solve but my javascript skills are very poor.

    I have a website using frames. When people search on google or something it often show a page with the frames. So it shows just the page (here: friends.html) without the frames! Now, I have this code inside the friends.html page:

    <script language="JavaScript"><!--
    if (parent.location.href == self.location.href)
    window.location.href = 'frames.html';
    //--></script>

    So when someone goes to this page it goes to the frameset-page first. That's good! But, what I'd like to see, is that they go to the frameset-page and that it shows the page they found on the searchenigine (friends.html) inside the frames!

    Is this possible?

    Jennifer
  • Choopernickel
    CodingForum Regular
    • Apr 2003
    • 491

    #2
    This thread may help you out. Don't forget to search, and search again. What's a great challenge to you has in most likelihood been accomplished and shared by the greats on this forum - answers are all over the archives.

    Comment

    • oldcrazylegs
      CodingForum Regular
      • Feb 2004
      • 424

      #3
      Targeting frames

      Try <a href="javascript:void(0)" onclick="location.nameofyourframe.href='page.html'">Load Page Into Frame</a>
      Master Newbie http://dwightstegall.com/

      Comment

      • Travolta
        New to the CF scene
        • Mar 2004
        • 2

        #4
        Hmmm seems I got similar problem - I need to open location.href in one of the frames, but I think mentioned above solution wont work (
        ...
        <TD class=table1 style="CURSOR: pointer"
        onclick="location.middle.href='Frame_B.html'"
        background=footer_box_1.jpg>
        ...
        I call page Frame_B.html to be loaded into frame named "middle". But I use this JS from one of the frames and as I guess thats why it doesnt understand the name of frame from frameset. Am I right ? And if so, are there any ways to solve my prob ?

        Comment

        • glenngv
          CodingForum Veteran
          • Jun 2002
          • 11149

          #5
          onclick="top.frames['middle'].location.href='Frame_B.html'"

          or better

          onclick="window.open('Frame_B.html','middle')"
          Glenn
          vBulletin Mods That Rock!

          Comment

          • Travolta
            New to the CF scene
            • Mar 2004
            • 2

            #6
            glenngv Thank you very much!

            I understand now - my mistake was that I always thought that window.open means that document will be opened in a new window! Thank you again!

            Comment

            Working...
            X