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
    New Coder
    Join Date
    Jul 2005
    Location
    Alabama
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Preventing page from rendering in a frame

    Is there a way to add something to the body element so that you web page will not show up in someone else's frame. Another example someone makes a web page with frames and one of the frames links to your web site, but you do not want you page to show up in their frame rather a new window?
    Mandriva Club = $12.00/month
    Internet connection = $29.00/month
    A decent laptop = $1200.00
    Switching to Linux = Priceless

    Linux Member # ?????

  • #2
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    It's not 100% foolproof but it's normally called a frame-breaker:
    Code:
    if(top.location != document.location) {
    	top.location.replace(document.location);
    }
    hope this helps

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #3
    New Coder
    Join Date
    Jul 2005
    Location
    Alabama
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thanks

    Excatly what I was looking for thanks a lot. It works perfect for what I need!!!
    Mandriva Club = $12.00/month
    Internet connection = $29.00/month
    A decent laptop = $1200.00
    Switching to Linux = Priceless

    Linux Member # ?????


  •  

    Posting Permissions

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