Can someone help me troubleshoot this code snippet?
jQuery('<iframe id="groundplan_popup" class="groundplan_hidden" />').appendTo("#popup_holder");
var iframe = jQuery("#groundplan_popup");
iframe.attr("src","::censored::" + filename);
var iframe_body = iframe.contents().find('body').append('<div id="groundplan_popup_exit"></div>');
var exit_btn_gp = iframe_body.append(jQuery("#groundplan_popup_exit"));
I'm struggling to create a div with an id of "groundplan_popup_exit" within the dynamically generated iframe. The console warning about the deprecated /deep/ combinator is confusing me further. I don't know if that's related to the issue.
EDIT:
Here's how my code currently looks: https://i.sstatic.net/kZ1oB.png
Console screenshot: https://i.sstatic.net/RaNwF.png
Screenshot of the iframe console elements:
https://i.sstatic.net/7SMcF.png
I'm quite new to using jQuery and iframes, so any guidance on why the #groundplan_popup_exit div isn't being created would be appreciated.