Más contenido relacionado Similar a Html5 Javascript APIs (20) Html5 Javascript APIs3. 3
HTML5 “HTML5”
• Canvas 2D Context • Web Workers
• Microdata (& vocabularies) • Web Storage
• Cross-document messaging • Web Sockets (API & protocol)
• Channel messaging • Server-side events
• Forms • Geolocation API
• SVG, MathML, XHR2
8. 7
OUTLINE
• Constraint validation API
• Canvas 2dContext API
• localStorage API
• Geolocation API
• Life-changing demo™
11. 10
CONSTRAINT VALIDATION API
el.validity.valueMissing required
el.validity.typeMismatch type
el.validity.patternMismatch pattern
el.validity.tooLong maxlength
el.validity.rangeUnderflow min
el.validity.rangeOverflow max
el.validity.stepMismatch step
el.validity.customError N/A
el.validity.valid N/A
13. 12
Demos!
http://miketaylr.com/pres/ncjs/
(http://bit.ly/ncjs-mt)
21. 20
CANVAS 2D CONTEXT API
Transformations
Compositing
Colors and styles
Line styles
Shadows
Simple shapes (rectangles)
Complex shapes (paths)
Focus management
Text
Images
Pixel manipulation
22. 20
CANVAS 2D CONTEXT API
Transformations
Compositing
Colors and styles
Line styles
Shadows
Simple shapes (rectangles)
Complex shapes (paths)
Focus management
Text
Images
Pixel manipulation
24. 22
Example 2.2 Canvas Rectangle
var
29. 27
GEOLOCATION API
getCurrentPosition(success, error, options)
watchPosition(success, error, options)
options: enableHighAccuracy,
timeout
maximumAge
30. 28
GEOLOCATION API
position.coords.latitute
position.coords.longitude
position.coords.altitude
position.coords.accuracy
position.coords.altituteAccuracy
position.coords.heading
position.coords.speed
34. 32
Demo!
http://miketaylr.com/pres/ncjs/app/