-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathders16.js
More file actions
25 lines (23 loc) · 774 Bytes
/
ders16.js
File metadata and controls
25 lines (23 loc) · 774 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
// cookie
// sunucudan da atanabiliyor
// yani js disindada atanabilir
document.cookie = 'name=burak';
document.cookie = 'surname=altinsoy';
// burada coookie ustune ekler silme yapmaz
// silmek icinse
// cookie expires yazarak bakabilirsin
// local storage single pagelerde kullanmak daha mantikli
// daha esnek daha kabiliyetli
localStorage.name = 'burak';
localStorage.getItem('name');
localStorage.setItem('name', 'merhaba');
// silmek icinse
localStorage.removeItem('name');
// sadece string kaydedebilirsiniz
// JSON bile kaydedersiniz string olarak tutar
// bu sekilde tutabilirsiniz
localStorage.setItem('name', JSON.stringify({ a: 1 }));
localStorage.getItem('name');
JSON.parse(localStorage.getItem('name'));
// js lzw compression
// kucultmek icin bakabilirsin