320 likes | 556 Views
Using JavaScript to Build HTML5 Applications. Jonathan Carter joncart@microsoft.com www.lostintangent.com @lostintangent. What questions are we going to address?. Prologue What does “HTML5” even mean? Why should you care about it? What are some development considerations? Story
E N D
Using JavaScript to Build HTML5 Applications Jonathan Carter joncart@microsoft.com www.lostintangent.com @lostintangent
What questions are we going to address? Prologue • What does “HTML5” even mean? • Why should you care about it? • What are some development considerations? Story • Is JavaScript ready for mainstream usage? • What kind of scenarios can JavaScript enable?
“HTML5” strives to make them usable for building real applications
So HTML5 is an umbrella term for… • HTML (v5+) Increased semantics, multimedia, graphics, etc. • CSS (Level 3+) Richer selectors, layout systems, animations, fonts, etc. • JavaScript (ECMAScript 5+, DOM) Strict mode, new APIs (e.g. background processes, file access, bi-directional server communication)
Why should you care? • Reason #1: HTML5 is the direction the industry is moving • Reason #2: HTML5 applications will have the broadest reach across consumer devices • Reason #3: You shouldn’t need another reason
What are some development considerations? • It’s a progressively usable set of technologies • Use what browsers support • Get familiar with features that are coming • HTML5 is a client technology • Server-interaction should be kept to a minimum • Factor all UI-agnostic functionality into services • You need to know JavaScript (and other libraries) very well
Is JavaScript ready for mainstream usage? • Performance? • Browser compatibility? • Community? • Esoteric language?
The JavaScript language can be pretty hostile
ES5 Strict Mode demo
What kind of scenarios can JavaScript enable? • Multimedia (audio/video) • Graphics (animation, image manipulation) • Geolocation • Storage (key-value pair, “relational” store) • Bi-directional server communication • Background processes • File access (drag-and-drop) • Much more…
Multimedia demo
Since we’re developing for the client, we need to save some state somewhere…
Web Storage • Key-value store • Values must be strings • JSON.stringify is your friend • ~5mb+ storage (cookies are ~4kb) • Application and session scope
Web Storage demo
Location awareness has become a key ingredient to nearly every major web property
Geolocation demo
Prettier software tends to be more successful in the consumer space
Canvas • 2D/3D Graphic space • Can render… • Shapes (paths, rectangles) • Images • Text • Supports transformations • Etc.
<canvas> demo
Summary • HTML5 is an emerging approach to building applications with broad reach • JavaScript is a powerful language that is greatly simplifying its esoteric nature and is gaining a ton of new APIs • HTML5 may not be approachable enough for you today, but it’s getting there very quickly
Web Track Resources • http://www.asp.net/ • http://www.silverlight.net/ • http://www.microsoft.com/web/gallery/ • http://www.iis.net/ • http://weblogs.asp.net/Scottgu/ • http://www.hanselman.com/blog/
Resources • Connect. Share. Discuss. http://northamerica.msteched.com Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet • http://microsoft.com/msdn
© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.