13. <html> /jAVAsCRIPT(); NATIVE MEDIA
var video // video element
function playPause() {
if (video.paused || video.ended) {
video.play();
} else {
video.pause();
}
}
http://Video object API
16. if (Modernizr.canvas) { // let's draw some shapes! } else { // no native canvas support available :( }
<html> /jAVAsCRIPT(); drawing
<CANVAS>
• Rysowanie w JS
• Wykresy
• Gry etc.
Nessie 150
Wendigo 150
Sasquatch 300
Chupacabra 100
Yeti 50
17. jAVAsCRIPT(); New Events
WINDOW onerror
onhashchange
ononline / onoffline
onpagehide / onpageshow
(...)
HTML ELEMENTS ondrag / ondragstart / ondragend
ondrop
oninvalid
(...)
18. jAVAsCRIPT(); Offline web
Web Storage (cookie na sterydach)
• 5 mb na DANE
• Trwałe
• Nie przesyłane na serwer (!)
Application cache
• <html manifest="/cache.manifest">
• CACHE / NETWORK / FALLBACK
21. No i jeszcze...
• history api
• Drag & drop
• Drag in
• Geolocation
• Microdata
• ARIA attributes
• Web SQL Database / IndexedDB
• (...)
22. HTML5 TERAZ!
Ale...
• Zadbaj o Wsteczną zgodność...
• ...I o Dobre Wersje alternatywne
• Nie uzależniaj kluczowych funkcjonalności...
• ...chyba, że piszesz dla konkretnej przeglądarki
23. Modernizr.com
Detekcja funkcjonalności nie przeglądarki!
function supports_canvas() {
var d = document;
return !!d.createElement('canvas').getContext;
}
if (supports_canvas) {
// let's draw some shapes!
} else {
// no native canvas support available :(
}