views:

25

answers:

2

How would I check if the page is being loaded in an iframe? Also, could I make a page change the main URL to its own from within an iframe?

A: 

Both are possible and explained extensively in this post:

Coding Horror - We Done Been...Framed!

Keep in mind that these are not perfect solutions since the parent page can prevent you from doing these things using various methods (also discussed in the post).

Justin Niessner
A: 

To get the parent's tag/nodeName :

theParent = $(this).parent();
//alert(theParent[0].nodeName);
Babiker