Web Analytics Made Easy -
StatCounter "am I in a frameset" detector - CodingForum

Announcement

Collapse
No announcement yet.

"am I in a frameset" detector

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "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
    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

    Comment


    • #3
      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.

      Comment

      Working...
      X