Detect If Your Site is in Iframe

Simply you want to know whether your site, is being used/shown in iframe at somebody’s site is to use javascript.


<script>
if(window.parent.frames.length > 0)
{
alert(“site in iframe”);//put your code in here if your site is in iframe
}
</script>

If you use the above code, it will show an alert for that user if somebody is showing your site in iframe.

Leave a Reply

Your email address will not be published. Required fields are marked *