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
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts

    function to detect if a page is iframed?

    Is there a function to detect if a page is iframed?

    ex.

    <div align="center">
    <IFRAME name="iframe_name" id="iframe_id" src="test.htm" scrolling="no" width="550" height="410" frameborder="0">
    </IFRAME>
    </div>

    How to check inside 'test.htm' if test.htm is placed in an iFrame?

    Tx

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Posts
    3,467
    Thanks
    0
    Thanked 0 Times in 0 Posts
    function inFrames()
    {
    return ( top != self );
    }
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you -- so simple but high effective


  •  

    Posting Permissions

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