-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJStorage.html
More file actions
50 lines (38 loc) · 1.2 KB
/
JStorage.html
File metadata and controls
50 lines (38 loc) · 1.2 KB
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
<html>
<body>
<p> JStorage test </p>
<form id="data">
<input type="text" placeholder="key" id="key">
<input type="text" placeholder="value" id="value">
</form>
<script src="//cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js"></script>
<script src="https://raw.github.com/andris9/jStorage/master/jstorage.js"></script>
<script src="js/jstorage.min.js"></script>
<script src="js/prototype.js"></script>
<script> /* $.jStorage is now available */ </script>
<script>
function echo(){
alert(document.getElementById("key").value);
};
function save(){
alert("saving...");
$.jStorage.set(document.getElementById("key").value, document.getElementById("value").value);
alert("saved");
};
function get(){
alert("retrieving...");
alert($.jStorage.get(document.getElementById("key").value));
alert("retrieved");
};
function flush(){
alert("flushing...");
$.jStorage.flush();
alert("flush");
};
</script>
<input type="button" onclick="echo()" value="echo"/>
<input type="button" onclick="save()" value="save"/>
<input type="button" onclick="get()" value="get"/>
<input type="button" onclick="flush()"value="flush"/>
</body>
</html>