Yeah, I was inside the iframe - sorry, I forgot to point that out! I very
much appreciate your solution - it is much simpler and very concise. Hard to
believe I spent 3 hours on it when the solution was only two lines of code!
Very cool. Again, thanks a billion!

Michael Geary wrote:
> 
>> 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/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Finding-parent-iframe--tf3201657.html#a8891503
Sent from the JQuery mailing list archive at Nabble.com.


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

Reply via email to