繁体   English   中英

Apache Cordova Visual Studio 2015 iframe

[英]Apache Cordova Visual Studio 2015 iframe

IFrame根本不起作用。 IFrame仅加载HTML,HEAD和BODY标签,如下所示:

<html>
  <head></head>
  <body></body>
</html>

//iframe is called in index.html
<iframe src="http://whatever.com" style="height:100%; width:100%;"></iframe>

InAppBrowser和其他东西正在工作。

如何正确做?

为什么IFrame不起作用?

我终于做到了! 因此,为我的IFrame提供解决方案。

HTML HEAD:

<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8">

IFrame的:

<iframe src="http://somewebsite.com" sandbox="allow-same-origin allow-scripts allow-popups allow-forms" id="activityFrame" style="width:100%; height:100%;" frameborder="0"></iframe>

config.xml文件:

<access origin="*" />
<access origin="http://somewebsite.com" /> //OR you can add it to Visual studio Dialog
<preference name="websecurity" value="disable" />

一切都应该正常工作。

我希望它可以帮助其他人。 :)

我使用它,并且在“启用滚动”的情况下,对于ios和android都可以正常工作

<div style="width:100%;height:100%;overflow:scroll !important;-webkit-overflow-scrolling:touch !important">
  <iframe src="http://whatever.com" scrolling="yes" style="width:100%;height:100%" frameborder="0"></iframe>
</div>

暂无
暂无

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

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