#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    425
    Rep Power
    0

    Break from iframe


    I would like to break an iframe if:

    1) the page is loaded in an iframe.
    2) The parent page is not in a specific domain.

    Can anyone assist me?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    425
    Rep Power
    0
    Is it even possible to get the url of the parent window if it's coming from a different domain?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2005
    Location
    Vancouver, WA, USA
    Posts
    425
    Rep Power
    0
    Since you cannot get info from a parent window if the domain is different, I had to do things a little differently than first expected.

    First I had to check the referrer URL using PHP. If this domain was not our own, and not myspace.com or facebook.com then I displayed the Javascript to break frame if there was one.

    Problem solved. Thank you!

    Comments on this post

    • derelict agrees : you're... uh... welcome? thx for following up with the solution!

IMN logo majestic logo threadwatch logo seochat tools logo