How To Understand If Page Is Loaded As Iframe (external Site) Using Javascript?
I'm trying to find a reliable solution to determine if my page was loaded in iframe on external site using javascript. If iframe src located on the same domain it's preaty easy: yo
Solution 1:
You might be interested in the Coding Horror entry: We Done Been Framed. Offers an interesting technical discussion on this topic, including solutions, and frame-busting-busting.
Solution 2:
You can wrap your validation (window.location !== window.parent.location / window.frameElement) in try-catch statement which you can use to handle the exception yourself.
Post a Comment for "How To Understand If Page Is Loaded As Iframe (external Site) Using Javascript?"