some adjustments for lumia

This commit is contained in:
Bruno Windels 2020-03-21 23:20:13 +01:00
parent 7ce13b0fd0
commit ae01a65b3c

View file

@ -4,8 +4,8 @@
<meta charset="utf-8"> <meta charset="utf-8">
</head> </head>
<body> <body>
<button id="doit">Do It!</button> <button id="doit">Do It 3!</button>
<script type="module"> <script type="text/javascript">
function reqAsPromise(req) { function reqAsPromise(req) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
req.addEventListener("success", event => resolve(event.target.result)); req.addEventListener("success", event => resolve(event.target.result));
@ -21,7 +21,8 @@
} }
async function main() { async function main() {
let isNew = false; try {
const openReq = window.indexedDB.open("two-read-write-txn", 1); const openReq = window.indexedDB.open("two-read-write-txn", 1);
openReq.onupgradeneeded = (ev) => { openReq.onupgradeneeded = (ev) => {
const db = ev.target.result; const db = ev.target.result;
@ -69,6 +70,9 @@
alert("done " + JSON.stringify(value3)); alert("done " + JSON.stringify(value3));
} catch (err) {
alert(`error ${err.message} ${err.name} ${err.stack}`);
}
} }
document.getElementById("doit").addEventListener("click", main); document.getElementById("doit").addEventListener("click", main);
</script> </script>