jQuery mobile and iframes to load external websites

jQuery mobile and iframes to load external websites

I'm using some kind of modal window with an iframe to load external websites into my webapp. If somebody clicks an external link, the modal window will pop-up and the source of the iframe changes to an URL.


In my example i'm using Google as an external URL:
  1. <a href="http://www.google.com/" rel="external" data-ajax="false">Link to Google.com</a>
 
My modal window:
  1. <div id="modal">
  2. <header>
  3. <span class="close">Close</span>
  4.                  <h1>External webpage</h1>
  5. </header>
  6. <iframe id="external" src="about:blank" width="100%" height="100%" style="background:#FFF; overflow:scroll"></iframe>
  7. </div>

My JS to actually open the modal window:
  1. // Opening
  2. $('a[target*="_blank"]').removeAttr('target').addClass('ExternalLink');
  3. $('a.ExternalLink,').click(function() {
  4. $('#external').attr('src',this);
  5. $('.ui-page, .ui-body-a').hide();
  6. $('#modal').show();
  7. $("html, body").animate({ scrollTop:0 });
  8. return false;
  9. });
  10. // Closing
  11. $('.close').click(function() {
  12. $('.ui-page, .ui-body-a').show();
  13. $('#modal').hide();
  14. $('#external').attr('src','about:blank');
  15. });

The problem is when hitting the close button jQuery mobile keeps showing the loading screen with the spinner. The iframe doesn't seem to work at all on mobile devices (iOS 4.3.1 + iphone 3gs & HTC Desire HD with android) but it does work in a webbrowser on a PC.

Does anyone of you had issues with using iframes and jquery mobile too?