After adding an InAppBrowser in place of the iframe I was using before, I eventually tried an iframe again, and the iframe now works without jumping over to the phone's browser, as it was doing before, and the iframe works consistently in both iOS and Android.
2 things changed from the time that iframes were broken to when they started working:
- I upgraded to Cordova 2.5
I started dynamically creating/adding the iframe to the page using jquery, rather than just unhiding an already-existing iframe, as I was doing initially:
$('<iframe src="whatever.com" height="100%" width="100%" frameborder="0"></iframe>').appendTo('body');
.
I didn't bother checking whether it was #1 or #2 that fixed the iframe issue (I'm guessing it's #1), but I thought I would post that it IS possible to get iframes working with a PhoneGap/Cordova app, in case someone else runs into the same problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…