6. HTML5 – keeping it simple
<!DOCTYPE html PUBLIC "-//W3C//DTD
XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtm
l1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
dir="ltr" lang="ru" xml:lang="ru">
<!DOCTYPE html>
<html lang="ru">
6
7. Offline data Storage - overview
Web Storage
Store key/value pairs locally
Same-origin restriction
Each origin gets 5MB of storage space
○ QUOTA_EXCEEDED_ERR exception
Indexed Database API
Web SQL Database
File API: Directories and System
7
8. Offline data Storage - Web Storage
//Getter
var foo = localStorage["bar"];
//Setter
localStorage["bar"] = foo;
//Getter for integer
var foo =
parseInt(localStorage["bar"]);
8
12. Web sockets
Full-duplex communication channel
Web Sockets provide an enormous
reduction in unnecessary network traffic
Use case A: Use case B:
1,000 clients 10,000 clients
polling every second polling every second
Use case C:
100,000 clients
polling every second
12
13. Geolocation
IP address
Triangulation:
Wi-Fi, GSM or GPS
http://html5demos.com/geo
13
28. <audio>, <video> - browser support
Browser (H.264/AAC) (VP8/Vorbis) (Theora/Vorbis)
.MPEG-4 .WebM .Ogg
Mozilla Firefox 3.6+ a a
<video>
Opera 10.63+ a a
Google Chrome 8.0+ a a a
Apple Safari 5.0.3+ a
Microsoft IE9+ a a
Browser (MP3) (Vorbis)
.MPEG-4 .Ogg
Mozilla Firefox 3.6+ a
<audio>
Opera 10.63+ a
Google Chrome 8.0+ a a
Apple Safari 5.0.3+ a
Microsoft IE9+ a
28
29. Feature detect
Detects support for
HTML5 & CSS3 features
http://www.modernizr.com/
Do not reinvent the wheel Use Modernizr!
29