151
rated 0 times
[
155]
[
4]
/ answers: 1 / hits: 103672
/ 14 Years ago, tue, january 4, 2011, 12:00:00
How can I tell from a page within an iframe, if the parent itself is also within an iframe?
Explanation:
My home page home.html
contains an iframe
<iframe src=sample.html></iframe>
I need to detect if home.html
(ie: parent of sample.html
) is within an iframe.
Code in sample.html
:
if(self==window)
{
alert('home.html is not in iframe');
}
else
{
alert('home.html is in iframe');
}
My question is not a duplicate. It's a different case.
More From » jquery