5 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8">
6 <link rel=
"shortcut icon" href=
"data:image/x-icon;," type=
"image/x-icon">
7 <title>Hello, sqlite3
</title>
9 .warning, .error {color: red}
10 .error {background-color: yellow}
13 flex-direction: column;
14 font-family: monospace;
15 white-space: break-spaces;
20 <h1>1-
2-sqlite3 worker demo
</h1>
22 const logHtml = function(cssClass
,...args
){
23 const ln
= document
.createElement('div');
24 if(cssClass
) ln
.classList
.add(cssClass
);
25 ln
.append(document
.createTextNode(args
.join(' ')));
26 document
.body
.append(ln
);
28 const w
= new Worker("demo-123.js?sqlite3.dir=jswasm"
29 /* Note the URL argument on that name. See
30 the notes in demo-123.js (search for
31 "importScripts") for why we need
33 w
.onmessage = function({data
}){
36 logHtml(data
.payload
.cssClass
, ...data
.payload
.args
);
39 logHtml('error',"Unhandled message:",data
.type
);