我使用phonegap创建了一个构建。在index.html文件中,我编写了一个用于加载网站的简单iframe。它的工作时,我从手机本地URL。但它不工作,如果我上传整个构建作为电话中的zip,然后从它下载apk文件。然后尝试在手机中安装该apk,显示应用程序错误。Phonegap(应用程序错误...发生网络错误)
我已经检查过访问起源,并试图给它里面的域名。但它根本没有工作。任何人都可以帮助我。
的config.xml和index.html给出这样下面
<access origin="*"/>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
<title>Testing</title>
</head>
<body>
<iframe src="http://www.w3schools.com" height="640px" width="100%" frameborder="0" scrolling="yes">
</iframe>
</body>
</html>
检查这个页面 - https://github.com/apache/cordova-plugin-whitelist/blob/master/README.md#content-security-policy - (<! - 允许iframe到https://cordova.apache.org/ - >) - 应该这样做。让我知道她生病后作为回答 – Tasos
看来,由于相同的原产地政策,不可能以这种方式从不同的域加载到您的应用程序,你给[cordova-plugin-inappbrowser](https: //github.com/apache/cordova-plugin-inappbrowser)试试吗? – Blauharley
@Tasos它不工作:(。仍然显示一个空白的白色屏幕:( –