How to check if a page is loaded inside Iframe in Javascript
Case / Problem
You want to treat a page loaded in iframe differently from when it's loaded normally in the body
Solution
Just compare the location between the parent and the iframe itself.
function isInIframe() {
return window.location !== window...
dr.codes1 min read