Please enable JavaScript.
Coggle requires JavaScript to display documents.
WEB API (HTML DOM ( Document Object Model ) :question::question: (events ,…
WEB API
-
-
WEB STORAGE
machanisms
localStorage
-
browser tricks
Safari
which in Private Browsing mode gives us an empty localStorage object with a quota of zero, effectively making it unusable
-
about
-
localStorage is similar to sessionStorage, except that while data stored in localStorage has no expiration time
-
-
about
The Web Storage API provides mechanisms by which browsers can securely store key/value pairs, in a much more intuitive fashion than using cookies. This article provides a walkthrough of how to make use of this simple technology
Data stored by one browser is not accessible by another browser. For example, data stored by Chrome is not seen by Firefox
obj.
Storage
iterate over stored data
ex.
for (var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
var value = localStorage.getItem(key);
// do something with the key and value
}
-
-
-
test storage ...
storageAvailable
ex.
-
if (storageAvailable('localStorage')) { // Yippee! We can use localStorage awesomeness}
else { // Too bad, no localStorage for us}
CONSOLE
timer
ex.
console.time('Timer1');
var items = [];
for(var i = 0; i < 100000; i++){
items.push({index: i});}
console.timeEnd('Timer1');
-
-
-
-
Workers
About
seperate thread
Since it’s on a separate thread, it has no access
-
-
-
-
:pencil2:
dedicated workers
:pencil2:
-
-
Service workers
About
What
a script that your browser runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction
include features
push notifications
- 1 more item...
-
history
Before service worker, there was one other API that gave users an offline experience on the web called AppCache
-
-
-
-