views:

108

answers:

1

I hope someone can help with this issue. I have a popup iframe using lytebox. I would like it that when i click a link in my iframe with the class "mylink" that it executes the ajax call and update a div in my main window with the id "mydiv". I know how to do the onclick events and the ajax call but i do not know how to access the "mydiv" from the main window and update it with the content. Any help on this would be greatly appreciated. Thanks.

+1  A: 

You can simply use window.parent.document to access the parent document from the iframe.

jQuery allows you to specify a context for searches, so you could then do:

$(myselector, window.parent.document);
Paolo Bergantino
Thank you very much. For other users, the jquery code is $('#elementid', window.parent.document).html();
Updated to reflect this.
Paolo Bergantino