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