加载外部url时出现Phonegap错误
Phonegap error on loading an external url?
我正在尝试在我的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
。选择"是"
任何想法?
你的www文件夹里有next.html吗?您的代码正在尝试加载apache.org,而没有等待它加载,它试图加载next.html。如果next.html不存在于www文件夹中,它会给出这个错误。
相关文章:
- Phonegap:获取访问令牌时出现LinkedIn登录错误
- Cordova:未捕获引用错误:chbrody没有使用SQLitePlugin.js定义PhoneGap
- Phonegap-Android 4.4-html5音频长度错误(javascript和媒体插件)
- Phonegap插件错误
- iOS上ajax中的phonegap XML解析器geting错误
- iOS上的Phonegap fileReader错误消息
- 如何解决这个"E/SQLiteLog(1259):(1)接近“;GROUP”:语法错误“;在phonegap中
- phonegap本地通知错误
- PhoneGap: 引用错误: 未定义连接
- 修复了在 PhoneGap 中使用 jQuery Mobile 的 jQuery 验证中导致错误错误的延迟回调
- PhoneGap 3.0.0 Tanelih 蓝牙插件在 Android 上已启用错误回调不起作用
- Phonegap SYNTAX_ERR上的 SQLITE 查询错误
- PhoneGap 中的 XML 解析错误
- 来自Phonegap的地理位置示例在Android上给出错误的警报
- Windows 7 上 Android 的 Phonegap 3.0 构建错误
- 找不到phonegap错误类的pushwoosh插件
- PhoneGap 3.6.3 错误安装在 Windows 中
- Phonegap错误-无法读取property 'capture'undefined"在And
- 使用web数据库的Phonegap错误:"表达式mydb的结果.事务不是一个函数
- 加载外部url时出现Phonegap错误