Sale is live! Enjoy 70% Off! Use Credit/Debit Cards in India and PayPal outside of India for better experience!

How to check if page opened in iframe


To check if page opened in iframe you can compare window.self and window.top Check the function below.

Source Code:

 <script>
	function is_in_iframe() {
		try {
			return window.self !== window.top;
		} catch (e) {
			return true;
		}
	}
</script>

Free - Download it right now!


Tested

Include all files

Demo Download
Compatible Browsers

Chrome, Firefox, Safari, Opera, IE9+, Edge

Technologies Used

HTML 5, JS, jQuery

Reviews and Comments