forked from jackieli123723/JavaScript.Utilities
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstoreTest.aspx
More file actions
33 lines (30 loc) · 1.23 KB
/
storeTest.aspx
File metadata and controls
33 lines (30 loc) · 1.23 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
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="storeTest.aspx.cs" Inherits="YanZhiwei.JavaScript.Utilities.store.js.storeTest" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>store.js Test</title>
<script src=/proxy/https/github.com/JavaScriptExample/JavaScript.Utilities/blob/master/YanZhiwei.JavaScript.Utilities/store.js/"json.js" type="text/javascript"></script>
<script src=/proxy/https/github.com/JavaScriptExample/JavaScript.Utilities/blob/master/YanZhiwei.JavaScript.Utilities/store.js/"store.js" type="text/javascript"></script>
<script src=/proxy/https/github.com/JavaScriptExample/JavaScript.Utilities/blob/master/YanZhiwei.JavaScript.Utilities/store.js/"storeWithExpiration.js" type="text/javascript"></script>
<script type="text/javascript">
if (store.enabled) {
store.set('person', { name: 'yanzhiwei', age: 100 });
var _person = store.get('person');
if (_person != null) {
console.log(_person.name + ':' + _person.age);
}
storeWithExpiration.set('foo', 'bar', 1000)
setTimeout(function () { console.log(storeWithExpiration.get('foo')) }, 500) // -> "bar"
setTimeout(function () { console.log(storeWithExpiration.get('foo')) }, 1500) // -> null
}
console.log('store enable:' + store.enabled);
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>