Submit into a iframe-popup

Submit into a iframe-popup

Hi everybody,
I'm using jquery mobile pop-up with an iframe inside. In my case the content of the iframe could do none, one or more page submit. The problem is that when I try to close the popup without doing a iframe content submit, everything goes ok, but when I do a submit into the iframe and then I call popup close, the content of the opener goes into iframe.
Seems like if iframe content loses information about his parent.


Here is the code...


Opening button:
  1. <input value="Open popup" data-theme="b" type="button" onclick="myOpenPopup();" />
  2. <a href="#mobilePopup" id="_MOBILEPOPUP" style="display:none;" data-position-to="window" data-inline="true" data-rel="popup"></a>

Function called on open:
  1. $("#mobilePopup").empty().append($("<iframe width=\"100%\" height=\"100%\" style=\"border: 0px; margin: 0px; padding: 0px;\"></iframe>").attr("src",urlNoCache(myURL)));
  2. $("#mobilePopup").css("width", winW-100).css("height", winH-100);
  3. $("#_MOBILEPOPUP").click();

Div on the page:
  1. <div data-role="popup" id="mobilePopup" data-overlay-theme="a" data-theme="d" class="ui-content"></div>

Closing function:
  1. parent.$("#mobilePopup").popup("close");



Hope that it's well explained...