> 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.

It sounds like your code is actually running inside the IFRAME, is that
correct? It sounded like you only had a reference to an element inside the
iframe, thus the ownerDocument/parentWindow/defaultView stuff to find the
frame window.

But if your code is running in the IFRAME, then "window" is already the
frame window. So you can simplify even further:

 var outerDiv = $(frameElement.parentNode); 
 cls = $('div.tb_close', outerDiv).get(0);

-Mike


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to