So I was. This is perfect, thanks!
I was able to take what you sent me and simplify it down to this:
var frameWindow = document.parentWindow || document.defaultView;
var outerDiv = $(frameWindow.frameElement.parentNode);
cls = $('div.tb_close', outerDiv).get(0);
Because I actually want to operate on a child of the outer div (which I
didn't specify as it wasn't relevant). And I figured out that I could use
document because when I am executing the javascript, I don't need the link,
merely the link's document, and document is what I need. Works in both FF
and IE as well.
Thanks a million for putting me on the right path! I worked for a couple of
hours on this before I asked; should have asked sooner! :)
James
Michael Geary wrote:
>
> You're mixing up two different kinds of "parents" - parent *node/element*
> and parent *window*.
>
> Assuming that anyTag is a valid reference to your <any tag>, then this
> code
> should work (it's based on tested code that I use):
>
> var frameDoc = anyTag.ownerDocument;
> var frameWindow = frameDoc.parentWindow || frameDoc.defaultView;
> var frameElement = frameWindow.frameElement;
> var outerDiv = frameElement.parentNode;
>
> -Mike
>
--
View this message in context:
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8890917
Sent from the JQuery mailing list archive at Nabble.com.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/