I'm developing an application with PhoneGap I use iframe alone, how do I overcome it does not load the iframe field
<!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>
You are loading content into an iframe in the main web view, which requires you to allow access to that content in the config.xml file.
By adding the following in config.xml, you allow the main web view to navigate to your URL when loading the iframe contents, and this then works:
<allow-navigation href="http://dnsmarket.net/*" />
I tested this with iOS and Cordova 6.2.0 and it works fine with the above change. I used your index.html as posted.
Documentation describing how to configure allow-navigation can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With