SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Force no frames

  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    England
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Force no frames

    Hi

    I have the following code in every page to force the page to load without any frames and it works fine.

    Code:
    <script language=javascript type="text/javascript"><!--
    if (top.location != self)
    {
    top.location = "#";
    }
    // --></script>

    There is one thing that annoys me, it means that the URL always ends with # in the address bar, even if it was never loaded from within a frame. I was just wondering if there is a better way of doing this without having to type in the absolute URL on each page.

  2. #2
    SitePoint Addict
    Join Date
    May 2000
    Posts
    313
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesn't top.location = location.href; work.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    England
    Posts
    49
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This just makes the page keep refreshing itself.

    Any other ideas?


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
  •