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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    North East England
    Posts
    853
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow "am I in a frameset" detector

    Is it possible for a page to detect whether it's in a frameset and disply - or not - a break frames button?

    [+] Computer/PC issues [+] Silverpaw3D
    ------------------------------------------------
    Never buy a dwarf with learning disabilities...

    ...it's not big, and it's not clever.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    paris, france
    Posts
    1,216
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if (top.location.href != location.href)
    {
    if(confirm("do you want to break these frames?"))
    {
    top.location.href = location.href
    }
    }

    that script should pop up a box asking if you wna to breakt the frames and if the user clicks yes then they pop!
    photoshop too expensive? use the GIMP! www.gimp.org

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    626
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could also place a script in the body section of your document to write out a link if it is in frames like this:
    <html>
    <head>
    <title>Break out of frames link</title>
    </head>
    <body>
    <TABLE ALIGN="center" BORDER="1" WIDTH="50%" HEIGHT="20%" CELLSPACING="0" CELLPADDING="0">
    <TR>
    <TD ALIGN="center" VALIGN="top">
    <SCRIPT LANGUAGE="javascript">
    if (window != top)
    {
    document.write("<A HREF='javascript:top.location.href = location.href'>Break Out of Frames</A>")
    document.close()
    }
    </SCRIPT>
    </TD>
    </TR>
    </TABLE>
    </body>
    </html>

    If you don't want a text link then you could also use an image. If you want a form button then you could write the appropriate form tags. Good Luck.


  •  

    Posting Permissions

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