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" />
一切都应该正常工作。
我希望它可以帮助其他人。:)
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句