www.webdeveloper.com
Results 1 to 3 of 3

Thread: prob with framesets and links from outside

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    1

    prob with framesets and links from outside

    I can't create a link to any internal pages in a site that I just took over. All links from elsewhere take me to the default page.

    It uses topFrame, mainFrame, and bottomFrame in a frameset to keep a consistent banner and footer, while different content pages swap in and out.

    The javascript file says:

    if (top.location == self.location) {

    top.location = '../default.htm'

    }

    It's obvious why the links keep resolving to the default page, but I have no idea what to change it to so that links to inside pages work. These pages have names like pictures.htm, join.htm, etc.

    I hope I gave enough detail to make sense, and appreciate any help you can offer.

  2. #2
    Join Date
    Nov 2002
    Location
    Flint, Michigan, USA
    Posts
    593
    At my site, I do exactly what I think you want, like this:

    * Let it load with the three pages as they normally would.
    * The content FRAME tag has an 'id="framec"' attribute.
    * The FRAMESET tag has "onload='OtherPage();'" as an attribute.
    * There is a JavaScript function called "OtherPage" which picks up the document.location to check for anything after a question (?) mark. This would be the target content page.
    * If that target exists and is different from the default, I use "window.frames['framec'].location=Target;" to reload that page within the frameset.
    Please give me a hand at http://www.gofundme.com/bkzr98.

  3. #3
    Join Date
    Apr 2006
    Location
    Houston
    Posts
    1,374
    Quote Originally Posted by jakespeare View Post
    I can't create a link to any internal pages in a site that I just took over. All links from elsewhere take me to the default page....
    This is why framesets are so hated

    If you are concerned about page links from "within" your site then all you need to do is add the "target=" attribute to all your <a> tags to tell the frameset which frame to open the page in. If you leave out "target=" it defaults to top.

    So

    <a href="somepage.html">Click</a>

    becomes

    <a href="somepage.htm" target="contentpagename">Click</a>

    If you want to have external links from "without" your site be able to load a page then you'll need to do something like jalarie was suggesting

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles