我正在尝试在我的 iOS phonegap 应用程序上加载一个外部 url。
我在我的index.html上使用它:
<!DOCTYPE html>
<html>
<head>
<title>window.open Example</title>
<script src="cordova-2.1.0.js"></script>
<script src="js/plugins/PushNotification.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
// external url
var ref = window.open(encodeURI('http://apache.org'), '_blank', 'location=yes');
// relative document
ref = window.open('next.html', '_self');
}
</script>
</head>
<body>
</body>
</html>
但是我得到了错误:
Failed to load webpage with error: The requested URL was not found on this server.
** 我确实将OpenAllWhitelistURLsInWebView
cordoba.plist 中的设置为yes。
任何的想法??