SlideShare a Scribd company logo
Maurice de Beijer
Who am I
 Maurice de Beijer
 The Problem Solver
 Microsoft Integration MVP
 DevelopMentor instructor
 Twitter:   @mauricedb
 Blog:      http://msmvps.com/blogs/theproblemsolver/
 Web:       http://www.HTML5Support.nl
 E-mail:    mauricedb@computer.org
What we aren’t going to cover
 But I would really like to!
    Asynchronous Module Definition/RequireJS
    TypeScript
    CSS3
    LESS/SASS
    Tooling
 But I will in my Modern Web Development session at
 the TechDays 
What are we going to cover
 Polyfills
 Semantic elements
 Databinding & templates
 WebSockets
 Drag/Drop
 Graphics
 Storing data in the browser
The demo application
   Multiple concurent users
   Business rules that need to be enforced
   Use charts for reporting
   Support multiple devices
     Desktop
     Tablet with touch
 Support old versions of Internet Explorer
    10 to 20% of users use Internet Explorer 8


                  http://bit.ly/DotNed
Polyfills
 Not every browser supports every HTML5 feature
    Especially true with old browsers
 Many missing features can be added using a polyfill
    Offers the standard API
    Often done in JavaScript
    JavaScript is slow in older browsers 
 A few good lists to check
    Modernizr HTML5 Cross Browser Polyfills
    HTML5 please
HTML5 Semantic elements
 New HTML5 elements
   <nav>
   <section>
   <header>
   <footer>
   <article>
   <aside>
HTML5 Semantic elements
 How about support?
HTML5 Semantic elements
 Why use them?
   Searchability
   Accessibility
 Neither really makes sense
   Search engines don’t really care
   Use WAI-ARIA for accessibility support
 Make sure to add support in older versions of IE
   Modernizr
   Html5Shiv
HTML5 Semantic elements
Databinding & templates
 Construct HTML snippets using JavaScript or jQuery
    Is tedious as best
 Use a richer application library
    Backbone
    Knockout
    Ember
    ...
 Choosing one is a matter of taste
    Checkout TodoMVC for a comparison with a to do app
    My choice is Knockout
Databinding & templates
WebSockets
 A bi-directional socket connection
    Between a web browser and the web server
 The server can push updates to the browser
    Refreshing the browser to see updates is so 2012 
 Not just for games and chat applications
   Any application where you want fast updates
   Decrease the chance of concurrency issues
WebSockets
 How about support?
WebSockets
 Suffers from lack of infrastructure support
    Routers and firewalls can cause issues
 The API is low level
    Messages are just simple objects
    You might need to retransmit missed messages
 Use ASP.NET SignalR
    Uses WebSockets if possible
    Otherwise it uses fallbacks like Comet
    Supports scale out scenarios
    Uses a very simple API
WebSockets
Drag and Drop
 Drag and drop can be a very intuitive user interaction
    Often seen as more fun by users
 Very common interaction on tablets
    But works equally well with a mouse
 HTML5 supports drag and drop
    Including dragging from the file system
Drag and Drop
How about support?
Drag and Drop
 Use jQuery UI instead of the HTML5 capabilities
    Use jQuery UI Touch Punch for touch support
    Add -ms-touch-action: none in CSS for Windows 8
Drag and Drop
Graphics
 Rich graphics are common in modern applications
    Interactive graphics
    Charts
 Often generated on the client
    Not just images downloaded from the server
 Two basic options
    Scalable Vector Graphics
    Canvas
Comparison of Canvas and SVG
Canvas                                        SVG
Pixel-based (canvas is essentially an image   Object Model-based (SVG elements are
element with a drawing API)                   similar to HTML elements)
Single HTML element similar to <img> in       Multiple graphical elements which become
behavior                                      part of the Document Object Model (DOM)
                                              Visual presentation created with markup and
Visual presentation created and modified
                                              modified by CSS or programmatically through
programmatically through script
                                              script
Event model/user interaction is coarse—at
                                              Event model/user interaction is object-based
the canvas element only; interactions must be
                                              at the level of primitive graphic elements—
manually programmed from mouse
                                              lines, rectangles, paths
coordinates
API does not support accessibility; markup-
                                             SVG markup and object model directly
based techniques must be used in addition to
                                             supports accessibility
canvas
SVG
 How about support?
Canvas
 How about support?
Graphics
 Use a library to make the API easier
    Don’t worry about Canvas versus SVG
 jqPlot is great for charts
    It uses canvas
    Includes exCanvas for IE 7/8 support
 Raphaël is a great choice for general graphics
    It uses SVG
    Uses VML for IE 7/8 support
Graphics
Storing data in the browser
 Lots of data changes only infrequently
    Don’t waste time by loading it every time
 HTTP caching can help
    But is less flexible
 HTML5 has two mechanisms for local storage
    LocalStorage is a simple dictionary
    IndexedDB is a document database
    Web SQL is also an option but has been deprecated
IndexedDB
 How about support?
LocalStorage
 How about support?
Web SQL Database
 How about support?
Storing data in the browser
 LocalStorage is well supported
    Except in very old versions of IE
 IndexedDB is much more powerful
    But the API is hard to use
 Lawnchair is easy to use
    Abstracts the underlying data storage
    Can use LocalStorage, IndexedDB or other storage
 db.js makes IndexedDB easy to use
    But requires a polyfill in old browsers
Storing data in the browser
Conclusion
 There is lots of goodness in HTML5
    But not everything is as useful
 Some of the API’s are hard to use
    But there are good libraries to make things easier
 Think about support with older browsers
    Use polyfills where needed


 Download the demo code

More Related Content

PPT
Practical HTML5
Maurice De Beijer [MVP]
 
PPT
Jquery
Swapnil & Patil
 
PDF
Modern UI Architecture_ Trends and Technologies in Web Development
Suresh Patidar
 
PPTX
Building SPA’s (Single Page App) with Backbone.js
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
PPTX
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
PPSX
Web technologies practical guide
samir azazy
 
PDF
Owning Web Performance with PhantomJS 2 - Fluent 2016
Wesley Hales
 
PPT
Quick Start: Rails
David Keener
 
Practical HTML5
Maurice De Beijer [MVP]
 
Modern UI Architecture_ Trends and Technologies in Web Development
Suresh Patidar
 
Building SPA’s (Single Page App) with Backbone.js
Microsoft Developer Network (MSDN) - Belgium and Luxembourg
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
Web technologies practical guide
samir azazy
 
Owning Web Performance with PhantomJS 2 - Fluent 2016
Wesley Hales
 
Quick Start: Rails
David Keener
 

What's hot (20)

PPTX
A Smooth Transition to HTML5
Chris Bannon
 
PDF
Bootstrap Presentation Mitesh
Mitesh Gandhi
 
PPTX
WebNetConf 2012 - Single Page Apps
Pop Apps
 
PPTX
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson
 
PDF
Quick Application Development with Web Frameworks
Stratepedia Presentations
 
PDF
Single page applications
Diego Cardozo
 
PDF
node.js in action
Karan Misra
 
PPTX
A Smooth Transition to HTML5 Using MVVM
Chris Bannon
 
PPTX
Single Page Application Development with backbone.js and Simple.Web
Chris Canal
 
PPTX
Single page application and Framework
Chandrasekar G
 
PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Eric Greene
 
PPTX
Making Single Page Applications (SPA) faster
Boris Livshutz
 
PDF
Introduction To Single Page Application
KMS Technology
 
PPTX
Wheel.js
baccigalupi
 
PDF
The shift to the edge
Jakub Wadolowski
 
PDF
The future of Activiti Cloud @ DevCon 2019
Mauricio (Salaboy) Salatino
 
PPTX
Web Based Development Introduction
Edy Segura
 
PDF
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Marie Smith
 
PPSX
Html5
sree1111
 
PDF
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
Tieturi Oy
 
A Smooth Transition to HTML5
Chris Bannon
 
Bootstrap Presentation Mitesh
Mitesh Gandhi
 
WebNetConf 2012 - Single Page Apps
Pop Apps
 
Edy Dawson Notes on SF HTML5 Dev Conf
Edy Dawson
 
Quick Application Development with Web Frameworks
Stratepedia Presentations
 
Single page applications
Diego Cardozo
 
node.js in action
Karan Misra
 
A Smooth Transition to HTML5 Using MVVM
Chris Bannon
 
Single Page Application Development with backbone.js and Simple.Web
Chris Canal
 
Single page application and Framework
Chandrasekar G
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Eric Greene
 
Making Single Page Applications (SPA) faster
Boris Livshutz
 
Introduction To Single Page Application
KMS Technology
 
Wheel.js
baccigalupi
 
The shift to the edge
Jakub Wadolowski
 
The future of Activiti Cloud @ DevCon 2019
Mauricio (Salaboy) Salatino
 
Web Based Development Introduction
Edy Segura
 
Google Developers Group Cloud Los Angeles, Progressive Web Applications by Ta...
Marie Smith
 
Html5
sree1111
 
27.1.2014, Tampere. Perinteinen mobiilimaailma murroksessa. Petri Niemi: Sing...
Tieturi Oy
 
Ad

Similar to Practical html5 (20)

PDF
Pablo Villalba -
.toster
 
PPSX
Web development concepts using microsoft technologies
Hosam Kamel
 
PPTX
Easy charting with
Major Ye
 
PPTX
Spsmi13 charts
Derek Gusoff
 
PDF
Workshop HTML5+PhoneGap by Ivano Malavolta
Commit University
 
PPTX
Front End Development | Introduction
JohnTaieb
 
PDF
Web Applications Are Technically Awesome!
MediaFront
 
PPTX
Get Started with JavaScript Frameworks
Christian Gaetano
 
PPTX
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
PPTX
An introduction to html5 by Devs
Debidatta Satapathy
 
PPT
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
Steve Drucker
 
PPSX
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
John Hartley
 
PDF
HTML5 Technical Executive Summary
Gilad Khen
 
PPTX
Building the next generation of browser apps today
Randy Williams
 
ODP
Html5
mikusuraj
 
PDF
HTML5: the new frontier of the web
Ivano Malavolta
 
PDF
Javascript Client & Server Architectures
Pedro Melo Pereira
 
PPTX
Give your web apps some backbone
RTigger
 
PDF
Making Of PHP Based Web Application
Sachin Walvekar
 
Pablo Villalba -
.toster
 
Web development concepts using microsoft technologies
Hosam Kamel
 
Easy charting with
Major Ye
 
Spsmi13 charts
Derek Gusoff
 
Workshop HTML5+PhoneGap by Ivano Malavolta
Commit University
 
Front End Development | Introduction
JohnTaieb
 
Web Applications Are Technically Awesome!
MediaFront
 
Get Started with JavaScript Frameworks
Christian Gaetano
 
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
An introduction to html5 by Devs
Debidatta Satapathy
 
JQuery Mobile vs Appcelerator Titanium vs Sencha Touch
Steve Drucker
 
Familiar Tools, New Possibilities: Leveraging the Power of the Adobe Web Pub...
John Hartley
 
HTML5 Technical Executive Summary
Gilad Khen
 
Building the next generation of browser apps today
Randy Williams
 
Html5
mikusuraj
 
HTML5: the new frontier of the web
Ivano Malavolta
 
Javascript Client & Server Architectures
Pedro Melo Pereira
 
Give your web apps some backbone
RTigger
 
Making Of PHP Based Web Application
Sachin Walvekar
 
Ad

More from Maurice De Beijer [MVP] (20)

PPTX
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Maurice De Beijer [MVP]
 
PPTX
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
 
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
 
PDF
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
 
PPTX
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
 
PPTX
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
 
PPTX
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
PPTX
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 
PPTX
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
 
PPTX
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
 
PPTX
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
PPTX
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
 
PPTX
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
 
PPTX
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
 
PPTX
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
PPTX
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
PPTX
The new React
Maurice De Beijer [MVP]
 
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Maurice De Beijer [MVP]
 
Production-ready Next.js App with Cursor AI
Maurice De Beijer [MVP]
 
Building Robust Web Applications with Test-Driven Development and Playwright:...
Maurice De Beijer [MVP]
 
Mastering React Server Components and Server Actions in React 19
Maurice De Beijer [MVP]
 
Practice TypeScript Techniques Building React Server Components App
Maurice De Beijer [MVP]
 
A foolproof Way to Estimate a Software Project
Maurice De Beijer [MVP]
 
Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
Build reliable Svelte applications using Cypress
Maurice De Beijer [MVP]
 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
Concurrent Rendering Adventures in React 18
Maurice De Beijer [MVP]
 
Building reliable applications with React, C#, and Azure
Maurice De Beijer [MVP]
 
Building large and scalable mission critical applications with React
Maurice De Beijer [MVP]
 
Building Reliable Applications Using React, .NET & Azure
Maurice De Beijer [MVP]
 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
Building reliable web applications using Cypress
Maurice De Beijer [MVP]
 
Getting started with React Suspense and concurrent rendering
Maurice De Beijer [MVP]
 
React suspense, not just for Alfred Hitchcock
Maurice De Beijer [MVP]
 
From zero to hero with the Reactive extensions for JavaScript
Maurice De Beijer [MVP]
 
Why I am hooked on the future of React
Maurice De Beijer [MVP]
 
The new React
Maurice De Beijer [MVP]
 

Practical html5

  • 2. Who am I  Maurice de Beijer  The Problem Solver  Microsoft Integration MVP  DevelopMentor instructor  Twitter: @mauricedb  Blog: http://msmvps.com/blogs/theproblemsolver/  Web: http://www.HTML5Support.nl  E-mail: [email protected]
  • 3. What we aren’t going to cover  But I would really like to!  Asynchronous Module Definition/RequireJS  TypeScript  CSS3  LESS/SASS  Tooling  But I will in my Modern Web Development session at the TechDays 
  • 4. What are we going to cover  Polyfills  Semantic elements  Databinding & templates  WebSockets  Drag/Drop  Graphics  Storing data in the browser
  • 5. The demo application  Multiple concurent users  Business rules that need to be enforced  Use charts for reporting  Support multiple devices  Desktop  Tablet with touch  Support old versions of Internet Explorer  10 to 20% of users use Internet Explorer 8 http://bit.ly/DotNed
  • 6. Polyfills  Not every browser supports every HTML5 feature  Especially true with old browsers  Many missing features can be added using a polyfill  Offers the standard API  Often done in JavaScript  JavaScript is slow in older browsers   A few good lists to check  Modernizr HTML5 Cross Browser Polyfills  HTML5 please
  • 7. HTML5 Semantic elements  New HTML5 elements  <nav>  <section>  <header>  <footer>  <article>  <aside>
  • 8. HTML5 Semantic elements  How about support?
  • 9. HTML5 Semantic elements  Why use them?  Searchability  Accessibility  Neither really makes sense  Search engines don’t really care  Use WAI-ARIA for accessibility support  Make sure to add support in older versions of IE  Modernizr  Html5Shiv
  • 11. Databinding & templates  Construct HTML snippets using JavaScript or jQuery  Is tedious as best  Use a richer application library  Backbone  Knockout  Ember  ...  Choosing one is a matter of taste  Checkout TodoMVC for a comparison with a to do app  My choice is Knockout
  • 13. WebSockets  A bi-directional socket connection  Between a web browser and the web server  The server can push updates to the browser  Refreshing the browser to see updates is so 2012   Not just for games and chat applications  Any application where you want fast updates  Decrease the chance of concurrency issues
  • 15. WebSockets  Suffers from lack of infrastructure support  Routers and firewalls can cause issues  The API is low level  Messages are just simple objects  You might need to retransmit missed messages  Use ASP.NET SignalR  Uses WebSockets if possible  Otherwise it uses fallbacks like Comet  Supports scale out scenarios  Uses a very simple API
  • 17. Drag and Drop  Drag and drop can be a very intuitive user interaction  Often seen as more fun by users  Very common interaction on tablets  But works equally well with a mouse  HTML5 supports drag and drop  Including dragging from the file system
  • 18. Drag and Drop How about support?
  • 19. Drag and Drop  Use jQuery UI instead of the HTML5 capabilities  Use jQuery UI Touch Punch for touch support  Add -ms-touch-action: none in CSS for Windows 8
  • 21. Graphics  Rich graphics are common in modern applications  Interactive graphics  Charts  Often generated on the client  Not just images downloaded from the server  Two basic options  Scalable Vector Graphics  Canvas
  • 22. Comparison of Canvas and SVG Canvas SVG Pixel-based (canvas is essentially an image Object Model-based (SVG elements are element with a drawing API) similar to HTML elements) Single HTML element similar to <img> in Multiple graphical elements which become behavior part of the Document Object Model (DOM) Visual presentation created with markup and Visual presentation created and modified modified by CSS or programmatically through programmatically through script script Event model/user interaction is coarse—at Event model/user interaction is object-based the canvas element only; interactions must be at the level of primitive graphic elements— manually programmed from mouse lines, rectangles, paths coordinates API does not support accessibility; markup- SVG markup and object model directly based techniques must be used in addition to supports accessibility canvas
  • 23. SVG  How about support?
  • 25. Graphics  Use a library to make the API easier  Don’t worry about Canvas versus SVG  jqPlot is great for charts  It uses canvas  Includes exCanvas for IE 7/8 support  Raphaël is a great choice for general graphics  It uses SVG  Uses VML for IE 7/8 support
  • 27. Storing data in the browser  Lots of data changes only infrequently  Don’t waste time by loading it every time  HTTP caching can help  But is less flexible  HTML5 has two mechanisms for local storage  LocalStorage is a simple dictionary  IndexedDB is a document database  Web SQL is also an option but has been deprecated
  • 30. Web SQL Database  How about support?
  • 31. Storing data in the browser  LocalStorage is well supported  Except in very old versions of IE  IndexedDB is much more powerful  But the API is hard to use  Lawnchair is easy to use  Abstracts the underlying data storage  Can use LocalStorage, IndexedDB or other storage  db.js makes IndexedDB easy to use  But requires a polyfill in old browsers
  • 32. Storing data in the browser
  • 33. Conclusion  There is lots of goodness in HTML5  But not everything is as useful  Some of the API’s are hard to use  But there are good libraries to make things easier  Think about support with older browsers  Use polyfills where needed  Download the demo code

Editor's Notes

  • #10: http://www.netmagazine.com/features/truth-about-structuring-html5-page
  • #23: See http://blogs.msdn.com/b/ie/archive/2011/04/22/thoughts-on-when-to-use-canvas-and-svg.aspx