Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts

    bookmarks, framed site

    Hi. I was wondering if someone here could help.

    I'm working with a simple framed web site, www.stargazing.net/mas/index.htm. A left side called frame.htm, and the right side called home.htm. In head section of home.htm I have the following JavaScript line:

    if (document.location.hash != "#noframes" && typeof(top.locsrch) != "string") document.location = "index.htm"

    ... If anyone calls an individual web page (example: www.stargazing.net/mas/photos2.htm) all they have to do is click [return to home], which runs home.htm. With this line of code, home.htm will then return you to the framed site.

    Just one problem. Suppose I want to get to a bookmark in home.htm, as in http://www.stargazing.net/mas/home.htm#observatory home.htm ignores it and launches me back to the framed site. Question. Is there a way to get passed this barrier and to the bookmark?

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't think so. That's the main argument against frames is that they have a state, but there's no way to save the state (like a bookmark..). Even iFrames don't work here..

    Most people are trying to use some sort of templating system so that there's a menu someplace that's always the same (which is usually the reason for having frames in the first place).

    Here are some articles I came across:
    http://forums.devshed.com/archive/t-168657
    http://developer.irt.org/script/174.htm

    Hope that helps,
    Sadiq.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In home.htm, I suppose I could do:

    if (document.location.hash != "#noframes" && typeof(top.locsrch) != "string") document.location = "index.htm" + document.location.hash

    ..but now index.htm has to feed the bookmark to home.htm in the right frame. Could it?

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    70
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What I did was to 'var tophash = location.hash' in my index.htm, then in home.htm do a:

    if (typeof(top.tophash) == "string" && top.tophash != "") {var h = top.tophash ; top.tophash = "" ; self.location = self.location + h}


    ...seems to work. Thanks for the help...Dennis


  •  

    Posting Permissions

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