iframes aren’t exactly the most widely used browser technology anymore, but that doesn’t meant that they don’t have their place, especially in WordPress development.
For those of you who have worked with features such as the Theme Customizer, then you are certainly familiar with how the feature is structured and the role that an iframe plays in giving you the controls and preview of the theme as you’re making changes.
Although it may not be terribly common, there are times in which you may need to check if a page is in an iframe.
There are a variety of reasons in which this may need to be done (dynamically adjusting the height or width of an element on resize, for example), and it’s really easy to do with a little bit of JavaScript.


