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 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ALERT if not in frames...two options

    Because I don't "know" JavaScript, I need someone to direct me to or write me a specific script.

    I need an ALERT to put on web pages within a framed web site. I do not want to break frames automatically -- I want to give the user the option. So, with the alert I need to give them a YES and a NO button. YES would open the web site in frames, and NO would allow them to remain on the exact non-framed page that they're already on.

    Any help?
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    hm... why javascript? To detect what? Just make a simple intro, in pure HTML, and give there the user a chance to follow framed or noframed versions...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Let me be more specific. My web site is framed -- no options about it. Some of my sub-pages are coming up in search engines. When a user then follows said link, they're given my sub-page out of it's frame. I do not, however, want to force frames. I want to give them the option to go to the main framed site via a JS alert. Does that help?
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    hm... that sounds familiar... some time ago I've put a related question here... I wondered if there is any possibility to force parent frame if children frames are loaded when found alone by search engine.

    Anyway, the general answer was that there is no client-side possibility to do that, so I don't think that your problem can be solved in this manner... but, yet, who knows...
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Actually it would only take a simple modification of the "force frames" script to do this.

    Code:
    if (top.location.href == location.href)
        {
         if (confirm("Show this page within it's proper frames?")) location.href = "place url for your frame here";
        }
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    TEXAS . . . 'nuf said
    Posts
    468
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks (again) Roy. All it takes is a little JS coding knowledge. I'm glad you have it...since I don't. Your code works perfectly.
    Gordo
    "In the End, we will remember not the words of our enemies, but the silence of our friends."
    - Martin Luther King Jr. (1929-1968)


  •  

    Posting Permissions

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