我是PhoneGap和Android的新手.我无法访问Extrenal URL’像来自PhoneGap的谷歌,我尝试了Iframe和Window.Location.Href,但不知道为什么它不起作用.
<!DOCTYPE HTML>
<html>
<head>
<title>PhoneGap</title>
<script type="text/javascript" charset="utf-8" src="phonegap-0.9.3.js"></script>
<link rel="stylesheet" href="jquery.mobile-1.0a1.min.css" />
<script src="jquery-1.4.3.min.js"></script>
<script src="jquery.mobile-1.0a1.min.js"></script>
</head>
<body>
<iframe src="http://www.google.com"></iframe>
</body>
</html>
解决方法:
您是否已将外部网址添加到白名单?项目中的/ res / xml中有一个名为PhoneGap.xml的文件
以下是我的一个PhoneGap.xml文件的示例:
<?xml version="1.0" encoding="utf-8"?>
<phonegap>
<access origin="http://127.0.0.1*"/>
<access origin="http://devgeeks.org"/>
<access origin="http://*.phonegap.com"/>
<log level="DEBUG"/>
</phonegap>
原文地址:https://codeday.me/bug/20190712/1442323.html
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。