-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (41 loc) · 1.05 KB
/
index.html
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
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<head>
<style>
html {
scrollbar-width: normal;
scrollbar-color: #777 #555;
}
.title {
size: 3em;
display: flex;
justify-content: center;
}
</style>
</head>
<body>
<h1 class="title">Local storage, Read file testing</h1>
</body>
<script>
function get_txt(name) {
fetch(name)
.then(response => response.text())
.then(data => {
console.log(data);
});
}
function get_local(name) {
const local = localStorage.getItem(name);
console.log(local);
}
function set_local(name, value) {
localStorage.setItem(name, value);
}
function remove_local(name) {
localStorage.removeItem(name);
}
function clear_local() {
localStorage.clear();
}
</script>
</html>