git_ast/test/onsen_ui/index.html
2021-02-04 14:59:33 +01:00

44 lines
1.8 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsenui.min.css">
<link rel="stylesheet" href="https://unpkg.com/onsenui/css/onsen-css-components.min.css">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="#">
<script src="https://unpkg.com/onsenui/js/onsenui.min.js"></script>
<title>Onsen UI Test</title>
<script>
// das hier funktioniert nur wenn die Seite mit https:// ausgeliefert wird
if('serviceWorker' in navigator) {
navigator.serviceWorker.register('/sw.js')
.then(() => console.log('Service worker registered'))
.catch(e => console.log(e));
}
function loadData() {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if(this.readyState == 4 && this.status == 200) {
document.getElementById("employeeList").innerHTML = this.responseText;
}
};
xmlhttp.open("GET", "employee.php?op=load", true);
xmlhttp.send();
}
</script>
</head>
<body>
<ons-page id="home">
<ons-toolbar id="home-toolbar">
<ons-icon icon="ion-navicon, material:md-menu"></ons-icon>
<div class="center">Home</div>
</ons-toolbar>
Hallo wach
<ons-button onclick="alert('clickerick a ding dong')">Click this</ons-button>
<ons-button onclick="loadData()">Load data</ons-button>
<div id="employeeList"><b>list of employees will be loaded here</b></div>
</ons-page>
</body>
</html>