我正在使用PhoneGap开发应用程序,我单独使用iframe,如何克服它没有加载iframe字段
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="css/index.css" />
<title>Hello World</title>
</head>
<body>
<div class="loader"></div>
<div class="iframe">
<iframe name="iframeName" width="320" height="480">></iframe>
</div>
<script type="text/javascript" src="js/jquery-3.0.0.min.js"></script>
<script type="text/javascript">
$("[name=iframeName]").attr("src", "http://dnsmarket.net/pdf");
</script>
</body>
</html>
发布于 2016-06-23 01:29:54
您正在将内容加载到主web视图中的iframe中,这要求您允许访问config.xml文件中的内容。
通过在config.xml中添加以下内容,您可以在加载iframe内容时允许主web视图导航到您的网址,然后此操作即可正常工作:
<allow-navigation href="http://dnsmarket.net/*" />
我用iOS和Cordov6.2.0测试了这一点,它在上面的更改中工作得很好。我使用了你发布的index.html。
描述如何配置允许导航的文档可以是found here。
https://stackoverflow.com/questions/37970317
复制相似问题