Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Redirect to a target frame?

  1. #1
    Join Date
    May 2006
    Posts
    259
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default Redirect to a target frame?

    My wife and I are using frame on our site and I had a script a while back that would load the “content.html” page should the user enter by some other page.

    For example:

    If someone had entered our site via www.domain.com/main.html the script would also load the “content.html” page. The “content.html” page is our navigation page.

    I’ve been looking around but can’t find what I’m looking for. Can someone help?

    Thanks…
    "Only dead fish flow with the stream".
    - Unknown

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    That's one of the downfalls of frames

    It all rides on the index.html (or whatever the frames page is)
    - Mike

  3. #3
    Join Date
    May 2006
    Posts
    259
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by mburt
    That's one of the downfalls of frames

    It all rides on the index.html (or whatever the frames page is)
    Yea I know, that's why I have to find that little script. Should I find it I'll be sure to post it for others.
    "Only dead fish flow with the stream".
    - Unknown

  4. #4
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Unless there's a way to read the page without reading it inside the frame, I don't see it being possible.
    - Mike

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    if(window.top != window) window.location.href = "/";
    How's that?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    Ah. *snaps fingers
    I never thought of that....

    But just a question: Why don't you use braces?
    - Mike

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    But just a question: Why don't you use braces?
    Because I don't like them.

    In a lot of cases, they add no readability at all, and just waste space. In fact, I find code with excessive amounts of braces scattered throughout it a lot harder to read than code with braces only where necessary. Also, with a single statement it makes more sense to me to read the whole line, if, expression, and statement, as a single statement, rather than mucking about with braces and ruining the flow of the code.

    Tastes may differ.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I agree. To a point . I find braces help me read the code, but comparing code to actual languages, I think without the braces, would make it more like our own languages.
    - Mike

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The only time I find braces help me to read the code is when I have complex nested if/else statements such as:
    Code:
    if(cond1)
      if(cond2)
        if(cond3)
          doSomething();
        else if(cond4)
          if(cond5)
            doSomethingElse();
          else doSomething2();
        else doSomething3();
      else doSomething4();
    Even that's not too tricky to read when indentation is used properly.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    May 2006
    Posts
    259
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by Twey
    Code:
    if(window.top != window) window.location.href = "/";
    How's that?
    I'm sorry Twey but I don't know what to do with that. I don't write codes so unless you tell me what I need to add to it, it's not going to be useful to me. Also, does it go in the head or body of my page?

    A little more help please...
    "Only dead fish flow with the stream".
    - Unknown

Bookmarks

Posting Permissions

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