1 / 15

HTML5, part III – API, …

HTML5, part III – API, …. Štěpán Bechynský , @ stepanb. Developer Evangelist Microsoft, Czech Republic. ECMAScript 5. Standard ECMA-262 http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf Test: http://test262.ecmascript.org /

fiona
Download Presentation

HTML5, part III – API, …

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. HTML5, part III – API, … Štěpán Bechynský, @stepanb Developer Evangelist Microsoft, Czech Republic

  2. ECMAScript5 • Standard ECMA-262 • http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf • Test: http://test262.ecmascript.org/ • Results: http://en.wikipedia.org/wiki/ECMAScript#Conformance_tests • New array methods • Enhanced object model • Other computational methods and functions • Strict mode • AsynchronusScriptExecution • <scriptasyncsrc=“library.js"></script>

  3. OfficialECMAScripttests http://test262.ecmascript.org/ Test Suite Ver.: ES5 NumberofTests: 11016 Test Suite Date: 2011-09-25 Last run: 2011-11-01

  4. Data URI • Embedding data in the context of a web page • Most common is tiny image embedded in a web page • Standalone web pages with graphics

  5. GeolocationAPI • Location based on IP address, Wi-Fi, GSM or GPS • User must confirm access to location

  6. <audio>, <video> and Javascript • You can write your own audio or video player • Independent on “build-in” controls

  7. Offline capabilities • Offline storage • localStorage • sessionStorage • Size 5 MB • Can’t be extended • Online and offlineevents • Application Cache API • Manifest: <html manifest="appcache.manifest"> • Object: window.applicationCache • Indexed Database API • http://www.w3.org/TR/IndexedDB/

  8. File API • Read data from files chosen by the user • New objects to represent data • Blob, File, FileReader • New methods to access data • readAsArrayBuffer • readAsBinaryString • readAsText • readAsDataURL

  9. Web SocketsAPI • Real-time duplex communication • First handshake uses HTTP protocol • No problems with proxy, firewall, etc. • Small overhead • Needs socket server • Internet Engineering Task Force (IETF)

  10. Web Workers • Runs script on background • All communication to and from the worker thread is managed through messages • postMessage • Onmessage • Can’t access DOM • Developer Tools contains Web Workers debugging support varworker=newWorker("worker.js") worker.addEventListener("message",callback,false); worker.postMessage(myData); onmessage=function (event) { postMessage(LongRunningCode(event.data)); }

  11. Drag and Drop • Attribute draggable • true - The content can be dragged • false- The content cannot be dragged • auto - The content takes the default browser behavior (text, links, and images are draggable; other elements are not) • Events • dragstart • dragover • drop • … • dataTransfer property of event argument contains D&D information • setData • getData • clearData

  12. Developer Tools • Internet Explorer 9 Developer Tools • Visual Studio 2010 SP1 • Web Standards Update for Microsoft Visual Studio 2010 SP1 • Visual Studio 2011 • Expression Web 4 SP2

  13. www.vyvijej.cz

  14. HTML5.cz • Shromažďuje české zdroje • Komunitní překlad knihy Marka Pilgrima „Dive into HTML5“

  15. Resources • Books • Introducing HTML5 by Bruce Lawson & Remy Sharp • W3C • W3C HTML5 Specification – www.w3.org/TR/html5 • HTML5 Test Suite – test.w3.org/html/tests/reporting/report.htm • Validator –validator.w3.org/ • Microsoft Internet Explorer 9 and 10 • Engineering Blog – blogs.msdn.com/ie/ • Beauty Of The Web – www.beautyoftheweb.com/experience/ • IE Test Drive – www.ietestdrive.com • HTML5 Labs – html5labs.interoperabilitybridges.com/

More Related