我想使用Apache Cordova和visual studio 2015将网站转换为Android应用程序。以下是我的index.html代码:
<!doctype html>
<html lang="en">
<head>
<title>Zoggle</title>
<script type="text/javascript" charset="utf-8" src="cordova.js"></script>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
//navigator.splashscreen.hide();
if (navigator.network.connection.type == Connection.NONE) {
networkError()
} else {
loadApp()
}
}
function loadApp() {
navigator.app.loadUrl("http://zoggle.zolmeister.com")
}
function networkError() {
navigator.notification.alert('Zoggle requires an internet connection')
var $net = document.createElement('div')
$net.innerHTML = 'Zoggle requires an internet connection'
document.body.appendChild($net)
}
</script>
<style>
body {
padding: 15px;
background: #23252e;
color: #01ced3;
text-align: center;
}
div {
font-size: 20px;
}
</style>
</head>
<body>
</body>
</html>
当我运行代码时,它会显示一个空白的黑页。我想加载链接给出的网页..请帮助。
答案 0 :(得分:-1)