簡體   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