简体   繁体   English

iframe使Phonegap / Cordova应用崩溃

[英]iframe crashes Phonegap/Cordova app

Recently I noticed some weird issue about using iframe in phonegap. 最近,我注意到有关在phonegap中使用iframe的一些奇怪问题。 If I create blank phonegap 2.6.0 build and insert into body of index.html the following code 如果我创建空白的phonegap 2.6.0,则将以下代码插入到index.html的正文中

<iframe src="http://google.com/" style="width: 300px; height: 300px;" onload="alert('loaded')"></iframe> 

After deployment to the device (tested on Android 4.0.3 SGS2) the app behaves somehow inconsistently. 部署到设备后(在Android 4.0.3 SGS2上进行了测试),该应用程序的运行方式会出现不一致的情况。 For example if I run the app after device reboot onload event isn't triggered and after approximately 15 seconds the app shuts down without any error messages. 例如,如果我在未触发设备重启后启动运行应用程序,并且在大约15秒钟后关闭了应用程序,则没有任何错误消息。 If I launch the app after that, alert appear and everything's fine 如果此后我启动该应用,则会显示警报,并且一切正常

Though there are number of issues about iframe in phonegap I didn't manage to find one similar to this. 尽管在phonegap中存在许多有关iframe的问题,但我没有找到与此类似的问题。 Maybe anyone has an idea why that could happen and how to fix it 也许有人知道为什么会发生这种情况以及如何解决它

Cheers 干杯

Looks like super.clearCache(); 看起来像super.clearCache(); solves the problem. 解决了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM