-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patht8.2.html
More file actions
44 lines (27 loc) · 678 Bytes
/
t8.2.html
File metadata and controls
44 lines (27 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<pre>
key <input id=key>
value <input id=value>
<button onclick="put()"> put </button>
<hr />
key <input id=search>
<button onclick="get()"> get </button>
value <input id=result>
</pre>
<script src="potjs/lib/pot-web.js" verbosity=2></script>
<script>
var kvs
(async () => {
await pot.ready()
kvs = await pot.new()
})()
async function put() {
key = document.getElementById('key').value
value = document.getElementById('value').value
await kvs.put(key, value)
}
async function get() {
key = document.getElementById('search').value
value = await kvs.get(key)
document.getElementById('result').value = value
}
</script>