-
Notifications
You must be signed in to change notification settings - Fork 0
/
web-storage.txt
52 lines (28 loc) · 949 Bytes
/
web-storage.txt
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
Web Storage
code example -> szeryf.github.com/storage.html
function set_secret() {
localStorage['secret'] = prompt('secret:');
}
function show_secret() {
alert(localStorage['secret']);
}
localStorage & sessionStorage
sessionStorage: browser session scoped
(better than cookies in some situations, e.g. simultaneous transactions in multiple browser windows)
HTML5 STORAGE SUPPORT
IE FIREFOX SAFARI CHROME OPERA IPHONE ANDROID
8.0+ 3.5+ 4.0+ 4.0+ 10.5+ 2.0+ 2.0+
size restrictions
5 MB (IE8: 10MB)
Little big details
- small settings like last used tab, sorting, search mode, search term, view mode
Alternatives (session, cookies, db) clunky or tiresome
Immediate engagement -> http://www.slideshare.net/bokardo/designing-for-social-traction
Instead of:
sign-up => use => customer
Try:
use => sign-up => customer
Small problem
(another browser)
Bigger problem
(another computer)