Friday, 27 September 2013

JQuery - how to close a parent element from within an iFrame in the parent element?

JQuery - how to close a parent element from within an iFrame in the parent
element?

couldn't find anything similiar to my problem.
I am writing DIVs by
var dialog = $('<div id="dialog-overlay"></div><div
id="dialog-box"></div><div
id="dialog-container"></div>').appendTo('body');
Within the div "dialog-container" I am creating an iFrame by
$("#dialog-container").html('<iframe id="ifrm" class="gs_iframe"
frameborder="0" scrolling="no"></iframe>');
Now the problem is that if I want to remove the element "dialog" from
withing the iFrame I only get undefineds. How can I do so please?
I know that I could remove each div by ID but think to would be easier and
at least cleaner to just remove the dialog object.
Thank u in advance.

No comments:

Post a Comment