SlideShare a Scribd company logo
HTML5
AIGA IN CONTROL ORLANDO 2010




CHRISTOPHER SCHMITT
h t t p : / / t w i t t e r. c o m / @ t e l e j e c t
WHO AM I?
• Someone    who doesn’t like to get bored.

 • (Nerd.)

• Web   designer since ’93

• Author   of ~10 books including CSS Cookbook, 3rd Edition*

• Member    of the Web Standards Project

 • Adobe TF    Co-Lead & EduTF member

 • Co-author    of InterACT with Web Standards (Peachpit, due Spring)
WHO ARE YOU?
[In Control 2010] HTML5
[In Control 2010] HTML5
[In Control 2010] HTML5
CASTING OUT XHTML
THINGS ARE GOOD
BETWEEN US, XHTML,
RIGHT?
I MEAN. WE GET ALONG WELL.
AND WE BOTH LIKE STUFF.
“THE ATTEMPT TO GET THE
WORLD TO SWITCH TO XML,
    INCLUDING QUOTES
AROUND ATTRIBUTE VALUES
AND SLASHES IN EMPTY TAGS
  AND NAMESPACES ALL AT
   ONCE DIDN'T WORK.”
   -SIR TIM BERNERS-LEE
5            %




http://dev.opera.com/articles/view/mama-markup-validation-report/
BLUEPRINTS VS REALITY
[In Control 2010] HTML5
[In Control 2010] HTML5
[In Control 2010] HTML5
[In Control 2010] HTML5
“TAKE CARE
  OF THE LUXURIES AND
THE NECESSITIES WILL TAKE
 CARE OF THEMSELVES.”
 -FRANK LLOYD WRIGHT
RELEARNING SYNTAX
• Attribute    quotes “not really” required

• UPPERCASE        and lowercase HTML elements allowed

  • So   is CaMeLcAse typing.

• No   more need to do self-closing tags like <IMG /> or <BR />

• Also, no    more minimalization. So, this is okay: <dl compact>

• Basically, everything    that was bad from HTML4 in XHTML5 is good again.

  • Full   circle, baby!
STARTING OUT
BASIC HTML5 LAYOUT
DOCTYPE
HTML 4.01 Transitional DTD:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">

XHTML 1.0 Transitional DTD:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <title>DOWNTOWN ORLANDO RESTAURANTS</title>
</head>
<body>
 <h1>....</h1>
 <p>...</p>
 </body>
</html>
EXERCISE
• Goto HTML validator at
 http://validator.w3.org/#validate_by_input

• Then   type the following HTML (below) and hit validate:

               <!DOCTYPE html>
               <title>Small HTML5</title>
               <p>Hello world</p>
[In Control 2010] HTML5
[In Control 2010] HTML5
BUILDING WITH
    HTML5
DIV ID=”header”
               DIV ID=”nav”


DIV ID=”section”




                          DIV ID=”sidecolumn”
DIV ID=”article”




             DIV ID=”footer”
<HEADER>
             <NAV>


<SECTION>




                       <ASIDE>
<ARTICLE>




            <FOOTER>
<body>
 <header>
 <h1>Heading </h1>
 </header>
 <nav>
 <h3>Site Navigation</h3>
 <ul>...</ul>
 </nav>
 <section>
  <article>
 <h3>Weblog Entry</h3>
  </article>
 </section>
 <aside>
  <p>You are reading "Chocolate Rain", an entry posted on <time
datetime="2009-03-05">5 March, 2009</time>, to the <a href="#">Misty
collection</a>. See other posts in <a href="#">this collection</a>.</p>
 </aside>
 <footer>
 <p>...</p>
 </footer>
</body>
[In Control 2010] HTML5
[In Control 2010] HTML5
<script type="text/javascript">
document.createElement('header');
document.createElement('nav');
document.createElement('section');
document.createElement('article');
document.createElement('aside');
document.createElement('footer');
</script>




            http://ejohn.org/blog/html5-shiv/
[In Control 2010] HTML5
BASIC CSS FORMATTING
HEADER
           NAV


SECTION




                   ASIDE
ARTICLE




          FOOTER
[In Control 2010] HTML5
[In Control 2010] HTML5
LESSONS LEARNED
• New   HTML5 elements are treated as inline elements.

  • Need    to use CSS declaration “display:block”

• IE6and IE7 need to be nudged to recognize HTML elements in order
 to have CSS be applied

  • document.createElement(‘html5element’);

  • Dean    Edwards IE7 script doesn’t help

  • There   isn’t a jQuery plugin to make it “easier”
LESSONS LEARNED


• For   Firefox 2 and Camino (Gecko 1.9)

 • HTML5       pages need to be served as XHTML

 • Content-Type: application/xhtml+xml;

 • ...Let   the irony set for a bit.
<?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/2.0') > -1)
{
header("Content-Type: application/xhtml+xml; charset=UTF-8");
echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//
EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">';
}
else {
echo '<!DOCTYPE html><html>';
}?>



                          http://tr.im/h0Rj
NEW HTML5 ELEMENTS

• article        • embed          • nest

• aside          • event-source   • output

• audio          • figure          • progress

• canvas         • footer         • source

• command        • header         • time

• datagrid       • mark           • video

• datalist       • meter

• datatemplate   • nav
HTML5 AUDIO
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basic HTML5 Web Document Structure</title>

 </head>

 <body>
<h1>Video Example</h1>
<audio src="html5test.ogg" autoplay controls>

 <a href="html5test.ogg">Download audio</a>
</audio>

 </body>
</html>
[In Control 2010] HTML5
HTML5 AUDIO

• AUDIO  element attributes are SRC, AUTOBUFFER, AUTOPLAY,
  LOOP, CONTROLS

• If   you don’t have CONTROL, player becomes transparent
HTML5 AUDIO SUPPORT

             FF3.5+   S4+   Ch3+   Op10+


Ogg Vorbis     Y             Y


  MP3                 Y      Y


  WAV          Y      Y              Y
SUPPORTING AUDIO

<audio controls autobuffer>
 <source src="html5audio.mp3" />
 <source src="html5audio.ogg" />
 <!-- include Adobe Flash player EMBED and OBJECT code
here -->
</audio>
SUPPORTING AUDIO

• Ifyou do insert audio, setting the file to autoplay is not
  recommended, as it interferes with the experience for web surfers
  using screen readers.

• Don’t   use WAV file type.

   • Better   to ship a compact disc to the user instead.
HTML5 VIDEO
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basic HTML5 Web Document Structure</title>

 </head>

 <body>
<h1>Video Example</h1>
<object width="425" height="344"><param name="movie"
value="http://www.youtube.com/v/
4GuKSqAg5xI&hl=en&fs=1"></param><param
name="allowFullScreen" value="true"></param><param
name="allowscriptaccess" value="always"></param><embed
src="http://www.youtube.com/v/4GuKSqAg5xI&hl=en&fs=1"
type="application/x-shockwave-flash" allowscriptaccess="always"
allowfullscreen="true" width="425" height="344"></embed></
object>

 </body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Basic HTML5 Web Document Structure</title>

 </head>

 <body>
<h1>Video Example</h1>
<video src="html5test.ogg"

 width="320" height="240" controls

 poster="html5testvideoposter.jpg">

 <a href="html5testvideo.ogg">Download movie</a>
</video>

 </body>
</html>
VIDEO DEMO



• Play   the demo.
HTML5 VIDEO

• WIDTH   and HEIGHT should be required, IMO, but movie plays
  anyway based on the values in the video file itself.

• Video formats may have their own posterframe. The browser should
  use that by default unless overridden by valid POSTER attribute value.

• Text
     can be included within VIDEO element to allow user to
  download video if their browser doesn’t support.

• If   you want to give users control, use CONTROL attribute.
HTML5 VIDEO


• Videocan start automatically if using the AUTOPLAY=”1” attribute
 and value.

• Spec   provides for LOOP, AUTOBUFFER which also take a value of O
 or 1.

• Codecs   support...
HTML5 VIDEO
   “It would be helpful for interoperability if all browsers could
support the same codecs. However, there are no known codecs
    that satisfy all the current players: we need a codec that is
known to not require per-unit or per-distributor licensing, that is
compatible with the open source development model, that is of
   sufficient quality as to be usable, and that is not an additional
   submarine patent risk for large companies. This is an ongoing
 issue and this section will be updated once more information is
                               available.”
- http://www.whatwg.org/specs/web-apps/current-work/#video-
                and-audio-codecs-for-video-elements
CODECS

• Ogg    (or “Vorbis”)

 • No     need to worry about patents

• H.264

 • Created     by the MPEG group

 • If   you have blu-ray disc player, you are using it
CODEC SUPPORT

         FF3.5+   S   Ch   IE



Ogg        Y          Y



H.264             Y   Y
LESSONS LEARNED
• Used VLC  (http://www.videolan.org/vlc/) to encode common movie
 files types to OGG

• People   really, really, really want this to work,

 • However, feel    like to support every file format will take a lot of time

 • If
    you are hot to trot for HTML5 Video, like, right now, check out
   Mark Pilgrim’s tutorial:
   http://diveintohtml5.org/video.html

 • Good   primer:
   http://dev.opera.com/articles/view/introduction-html5-video/
[In Control 2010] HTML5
[In Control 2010] HTML5
HTML5 &
MICROFORMATS
REPLACING ABBR

• <ABBR>     element is used by screenreaders to expand abbreviations
 like “lbs” or “NCAAP”

• However unintended consequences occurred trying to workaround
 browser bugs for other HTML elements

• What   happens when a screenreaders text like this:

 • “Let’sgo to <abbr class="geo"
  title="30.300474;-97.747247">Austin, TX</abbr>”

http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
<div class="vevent">
 <a class="url" href="http://www.web2con.com/">http://
www.web2con.com</a>
 <span class="summary">Web 2.0 Conference</span>:
 <abbr class="dtstart"
title="2007-10-05">October 5</abbr>-
 <abbr class="dtend"
title="2007-10-20">19</abbr>,
at the <span class="location">Argent Hotel, San Francisco,
CA</span>
</div>
<div class="vevent">
  <a class="url" href="http://www.web2con.com/">http://
 www.web2con.com</a>
  <span class="summary">Web 2.0 Conference</span>:
  <time class="dtstart"
 datetime="2007-10-05">October 5</time>-
  <time class="dtend"
 datetime="2007-10-20">19</time>,
 at the <span class="location">Argent Hotel, San Francisco,
 CA</span>
 </div>


http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
POSTSCRIPT

• <ABBR>    issue has ben resolved with new pattern (dropping <ABBR>
 altogether):
 http://microformats.org/wiki/value-class-pattern

 • <p>Let’sgo to <span class="geo">51° 30' 48.45", -0° 8'
  53.23" (<span class="value">51.513458;-0.14812</span>)
  </span></span> </p>

• Thereby   microformats doesn’t rely on any HTML5 elements, and

• HTML5     spec isn’t looking to include microformats.
HTML5 CANVAS
<canvas id="myCanvas" width="300" height="150">
Fallback content, in case the browser does not support Canvas.
</canvas>
<script type="text/javascript"><!--
window.addEventListener('load', function () {
 // Get the canvas element.
 var elem = document.getElementById('myCanvas');
 if (!elem || !elem.getContext) {
   return;
 }

 // Get the canvas 2d context.
 var context = elem.getContext('2d');
 if (!context) {
   return;
 }

  // Now you are done! Let's draw a blue rectangle.
  context.fillStyle = '#00f';
  context.fillRect(0, 0, 150, 100);
}, false);
// --></script>
[In Control 2010] HTML5
// Get the canvas element.
 var elem = document.getElementById('myCanvas');
 if (!elem || !elem.getContext) {
   return;
 }

 // Get the canvas 2d context.
 var context = elem.getContext('2d');
 if (!context) {
   return;
 }

 context.fillStyle = '#00f';
 context.strokeStyle = '#f00';
 context.lineWidth = 4;

  // Draw a right triangle.
  context.beginPath();
  context.moveTo(10, 10);
  context.lineTo(100, 10);
  context.lineTo(10, 100);
  context.lineTo(10, 10);
  context.fill();
  context.stroke();
  context.closePath();
}, false);
[In Control 2010] HTML5
// Get the canvas element.
 var elem = document.getElementById('myCanvas');
 if (!elem || !elem.getContext) {
   return;
 }

 // Get the canvas 2d context.
 var context = elem.getContext('2d');
 if (!context) {
   return;
 }

 context.fillStyle = '#00f';
 context.strokeStyle = '#f00';
 context.lineWidth = 4;

  // Draw a right triangle.
  context.beginPath();
  context.moveTo(10, 10);
  context.lineTo(100, 10);
  context.lineTo(10, 100);
  context.lineTo(10, 10);
  context.fill();
  context.stroke();
  context.closePath();
}, false);
http://flickr.com/photos/dunstan/3099313036/
http://www.filamentgroup.com/lab/
jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas/
http://www.filamentgroup.com/lab/
jquery_visualize_plugin_accessible_charts_graphs_from_tables_html5_canvas/
<table >

    <caption>My Push Ups</caption>

    <thead>
<tr>

    <td></td>

    <th>M</th>

    <th>Tu</th>

    <th>W</th>

    <th>Th</th>

    <th>F</th>

    <th>Sa</th>
</tr>

    </thead>

    <tbody>
<tr>

    <th>Chris</th>

    <td>56</td>

    <td>30</td>

    <td>50</td>

    <td>0</td>

    <td>45</td>

    <td>120</td>

    <td>0</td>
</tr>

    </tbody>
</table>
[In Control 2010] HTML5
<link type="text/css" rel="stylesheet"
href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></
script><![endif]-->
<script type="text/javascript" src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
<link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://
ajax.googleapis.com/ajax/libs/jquery/1.3.2/
jquery.min.js"></script>
<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></
script><![endif]-->
<script type="text/javascript" src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
<link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]><script type="text/javascript"
src="excanvas.compiled.js"></script><![endif]-->
<script type="text/javascript" src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
http://msdn.microsoft.com/en-us/library/bb250524(VS.85).aspx
<link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></
script><![endif]-->
<script type="text/javascript"
src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
<link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></
script><![endif]-->
<script type="text/javascript" src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
table.accessHide {
 position: absolute;
 left: -999999px;
}
table { height: 100px; width: 250px;}
<link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/
jquery/1.3.2/jquery.min.js"></script>
<!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></
script><![endif]-->
<script type="text/javascript" src="visualize.jQuery.js"></script>
<script type="text/javascript">
$(function(){

 $('table').addClass('accessHide');

 $('table').visualize({type: 'line', colors: ['#fff']});

 });
</script>
[In Control 2010] HTML5
http://tr.im/Pjzy
QUICK INTERMISSION
    http://tr.im/Pjzy
HTML5 & LOCAL
  DATABASE,
  APP CACHE,
GEOLOCATION,
 YOUR PHONE
http://www.youtube.com/watch?v=VmjxmOtNZCk&fmt=18
DATABASE, APP CACHE,
           GEOLOCATION LINKS
• W3C HTML5 Database Storage Specification:
 http://tr.im/h13y

• W3C Geolocation API Specification:
 http://tr.im/h12L

• W3C HTML5 Offline Web Applications:
 http://tr.im/h12z

• Safari
      Dev Connection on HTML5 Offline Application Cache:
 http://tr.im/h12f

• WebKit
       Does HTML5 Client-Side Storage:
 http://tr.im/h140
“HTML 5 IS A KLUDGE.”
  - BRUCE LAWSON
http://ishtml5readyyet.com/
CAN HTML5
      TELL US
WHAT’S FOR DINNER?
[In Control 2010] HTML5
<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="utf-8">
  <title>Downtown Orlando Restaurants</title>
  <!--[if IE8]>
   <script src="http://html5shiv.googlecode.com/svn/
trunk/html5.js"></script>
  <![endif]-->
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <title>Downtown Orlando Restaurants</title>
 <!--[if IE]>
  <script src="http://
html5shiv.googlecode.com/svn/trunk/
html5.js"></script>
 <![endif]-->
<header>
...
</header>
<nav>
...
</nav>
<section>
...
</section>
<footer>
...
</footer>
<div id="" class="vcard">
 <a class="url fn n" href="http://www.310lakeside.net">

 <span class="given-name">Joanne</span>
 <span class="additional-name"></span>
 <span class="family-name">Smith</span>
</a>
 <div class="org">310 Lakeside</div>
 <div class="adr">
 <div class="street-address">301 East Pine Street</div>
 <span class="locality">Orlando</span>,
 <span class="region">FL</span>,
 <span class="postal-code">32801</span>

 <span class="country-name">USA</span>

</div>
<div class="tel">(407) 447-9310</div>

<div class="note distance">

</div>

</div>
http://zappatic.net/safarimicroformats/
https://addons.mozilla.org/en-US/firefox/addon/4106
[In Control 2010] HTML5
<a href=”http://h2vx.com/vcf/example.com/
    page.html”>Download contacts</a>
[In Control 2010] HTML5
GREAT, HTML5, BUT I’M
   HUNGRY NOW.
<script src="http://www.google.com/jsapi?
key=yourkeygoeshere"></script>
 <script>
   google.load("maps", "3",{"other_params":"sensor=true"});
   google.load("jquery", "1");
 </script>
if (navigator && navigator.geolocation) {
       // HTML5 GeoLocation
      function getLocation(position) {

 
updateMyLocation(position.coords.latitude,position.coords.lo
ngitude);

       proccessDirections.sortLocations(
          position.coords.latitude,
          position.coords.longitude
       );
     }
     navigator.geolocation.getCurrentPosition(getLocation);
[In Control 2010] HTML5
} else {
        // Google AJAX API fallback GeoLocation
       if ((typeof google == 'object') && google.loader &&
google.loader.ClientLocation) {

 
updateMyLocation(google.loader.ClientLocation.latitude,googl
e.loader.ClientLocation.longitude);

                proccessDirections.sortLocations(
                   google.loader.ClientLocation.latitude,
                   google.loader.ClientLocation.longitude
                );
            }
        }

   }
[In Control 2010] HTML5
addresses = $(locations).map(function(){
var $adr = $(this).find(".adr"), latLng = null, lat, lng;
WHAT NEXT?

• Check   your current location against the addresses in your listing.

• Withtwo points, we can determine the distance between where I am
 and where the food is located.

• With
     a list of values, I can sort those addresses based on the fewest
 amount of travel (did I mention I was hungry now?)

•I   can then also mention HOW far those distances are, too.
http://2010.incontrolconference.com/eats/
BUT WAIT....

• There   are a lot of restaurants in the list.

 • To   go back and forth for geoencoding the addresses will take time.

 • Wouldn’t    there be a faster way, if I had the time, to bypass that?
<div id="" class="vcard">

 
 
         <a class="url fn n" href="http://www.tmh.com/"> <span
class="given-name">John</span>

 
 
          <span class="additional-name"></span>

 
 
          <span class="family-name">Smith</span>

 
 
 </a>

 
 
         <div class="org">Tallahassee Memorial Hospital</div>

 
 
         <div class="adr" data-longitude="-84.260799"
data-latitude="30.456100" data-lang="js">

 
 
 
 <div class="street-address">1300 Miccosukee Road</div>

 
 
          <span class="locality">Tallahassee</span>,

 
 
          <span class="region">FL</span>


   
   
    <span class="country-name">USA</span>


   
   
   </div>

   
   
   <div class="tel">(850) 431-1155</div>


   
   
   </div>


        http://ejohn.org/blog/html-5-data-attributes/
if ((lat = $adr.attr("data-latitude")) && (lng =
$adr.attr("data-longitude"))) {
 latLng = new google.maps.LatLng(lat,lng);
 }
BUT WAIT....

•I   own an iPhone!
[In Control 2010] HTML5
[In Control 2010] HTML5
HTML5.
IT’S WHAT FOR DINNER.
THANK YOU!
    Christopher Schmitt
  schmitt@heatvision.com
http://twitter.com/@teleject
Creative Commons Citations

    http://www.flickr.com/photos/gurock20/459901107/
        http://www.flickr.com/photos/wili/214317898/
       http://www.flickr.com/photos/gadl/421838292/
     http://www.flickr.com/photos/tantek/1141384818/
http://dev.opera.com/articles/view/html-5-canvas-the-basics/

More Related Content

PDF
HTML5 Design
KEY
Looking into HTML5 + CSS3
PDF
[edUiconf] HTML5 does all that… and i can haz cheeseburger? You bet!
PDF
Using HTML5 sensibly
PDF
Multimedia on the web - HTML5 video and audio
PDF
HTML5 and the web of tomorrow!
PDF
Don't make me wait! or Building High-Performance Web Applications
KEY
HTML5 Video Player - HTML5 Dev Conf 2012
HTML5 Design
Looking into HTML5 + CSS3
[edUiconf] HTML5 does all that… and i can haz cheeseburger? You bet!
Using HTML5 sensibly
Multimedia on the web - HTML5 video and audio
HTML5 and the web of tomorrow!
Don't make me wait! or Building High-Performance Web Applications
HTML5 Video Player - HTML5 Dev Conf 2012

What's hot (20)

PPTX
The Rich Standard: Getting Familiar with HTML5
PPTX
HTML5 and CSS3 Techniques You Can Use Today
PPTX
What is HTML 5?
PDF
What the heck is HTML 5?
PDF
Introduction to html 5
PPTX
Edge of the Web
PDF
Taiwan Web Standards Talk 2011
KEY
HTML5: A brave new world of markup
PDF
Keypoints html5
PDF
[O'Reilly] HTML5 Design
KEY
It's a Mod World - A Practical Guide to Rocking Modernizr
PDF
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
PDF
Progressive Enhancement 2.0 (Conference Agnostic)
KEY
WHAT IS HTML5?(20100510)
PPTX
Untangling spring week8
PPTX
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
PPTX
Html5 shubelal
PDF
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
PPTX
Doing More with LESS for CSS
PDF
Progressive Downloads and Rendering - take #2
The Rich Standard: Getting Familiar with HTML5
HTML5 and CSS3 Techniques You Can Use Today
What is HTML 5?
What the heck is HTML 5?
Introduction to html 5
Edge of the Web
Taiwan Web Standards Talk 2011
HTML5: A brave new world of markup
Keypoints html5
[O'Reilly] HTML5 Design
It's a Mod World - A Practical Guide to Rocking Modernizr
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Progressive Enhancement 2.0 (Conference Agnostic)
WHAT IS HTML5?(20100510)
Untangling spring week8
HTML5 Bootcamp: Essential HTML, CSS, & JavaScript
Html5 shubelal
Pamela - Brining back the pleasure of hand-written HTML - Montréal Python 8
Doing More with LESS for CSS
Progressive Downloads and Rendering - take #2
Ad

Similar to [In Control 2010] HTML5 (20)

ZIP
Looking into HTML5
PDF
[amigos] HTML5 and CSS3
PDF
More On Html 5
PPTX
PPTX
Introduction to HTML5 and CSS3 (revised)
PPTX
PDF
Basics of HTML5 for Phonegap
PPT
HTML5_3.ppt
PPTX
Html5 tutorial
PPTX
Html 5
PDF
html5 _ Fundamentals a Basic Concepts of Understanding HTML.pdf
PPTX
Delhi student's day
PPT
Html5 tags
PDF
PPT
PPT
Html5
PPT
PPT
Html5
PPT
Looking into HTML5
[amigos] HTML5 and CSS3
More On Html 5
Introduction to HTML5 and CSS3 (revised)
Basics of HTML5 for Phonegap
HTML5_3.ppt
Html5 tutorial
Html 5
html5 _ Fundamentals a Basic Concepts of Understanding HTML.pdf
Delhi student's day
Html5 tags
Html5
Html5
Ad

More from Christopher Schmitt (20)

PDF
Keeping Colors from Killing Your Product
PDF
[funka] Adaptive Images in Responsive Web Design
PDF
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
PDF
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
PDF
[rwdsummit] Adaptive Images in Responsive Web Design
PDF
[artifactconf] Github for People Who Don't Code
PDF
[cssdevconf] Adaptive Images in Responsive Web Design
PDF
[parisweb] Adaptive Images in Responsive Web Design
PDF
[peachpit] Adaptive Images in Responsive Web Design
PDF
[jqconatx] Adaptive Images for Responsive Web Design
PDF
[wvbcn] Adaptive Images in Responsive Web Design
PDF
[drupalcampatx] Adaptive Images in Responsive Web Design
PDF
[refreshpitt] Adaptive Images in Responsive Web Design
PDF
[psuweb] Adaptive Images in Responsive Web Design
PDF
GitHub for People Who Don't Code
PDF
[wcatx] Adaptive Images in Responsive Web Design
PDF
[HEWEBFL] Adaptive Images in Responsive Web Design
PDF
[refreshaustin] Adaptive Images in Responsive Web Design
PDF
[sxsw2013] Extremely Compressed JPEGs
PDF
[html5tx] Adaptive Images in Responsive Web Design
Keeping Colors from Killing Your Product
[funka] Adaptive Images in Responsive Web Design
[Austin WordPress Meetup] Adaptive Images in Responsive Web Design
[CSSDevConf] Adaptive Images in Responsive Web Design 2014
[rwdsummit] Adaptive Images in Responsive Web Design
[artifactconf] Github for People Who Don't Code
[cssdevconf] Adaptive Images in Responsive Web Design
[parisweb] Adaptive Images in Responsive Web Design
[peachpit] Adaptive Images in Responsive Web Design
[jqconatx] Adaptive Images for Responsive Web Design
[wvbcn] Adaptive Images in Responsive Web Design
[drupalcampatx] Adaptive Images in Responsive Web Design
[refreshpitt] Adaptive Images in Responsive Web Design
[psuweb] Adaptive Images in Responsive Web Design
GitHub for People Who Don't Code
[wcatx] Adaptive Images in Responsive Web Design
[HEWEBFL] Adaptive Images in Responsive Web Design
[refreshaustin] Adaptive Images in Responsive Web Design
[sxsw2013] Extremely Compressed JPEGs
[html5tx] Adaptive Images in Responsive Web Design

Recently uploaded (20)

PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Encapsulation theory and applications.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPT
Teaching material agriculture food technology
PPTX
sap open course for s4hana steps from ECC to s4
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Encapsulation_ Review paper, used for researhc scholars
Agricultural_Statistics_at_a_Glance_2022_0.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Unlocking AI with Model Context Protocol (MCP)
Mobile App Security Testing_ A Comprehensive Guide.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Encapsulation theory and applications.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Spectral efficient network and resource selection model in 5G networks
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Advanced methodologies resolving dimensionality complications for autism neur...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Teaching material agriculture food technology
sap open course for s4hana steps from ECC to s4

[In Control 2010] HTML5

  • 1. HTML5 AIGA IN CONTROL ORLANDO 2010 CHRISTOPHER SCHMITT h t t p : / / t w i t t e r. c o m / @ t e l e j e c t
  • 2. WHO AM I? • Someone who doesn’t like to get bored. • (Nerd.) • Web designer since ’93 • Author of ~10 books including CSS Cookbook, 3rd Edition* • Member of the Web Standards Project • Adobe TF Co-Lead & EduTF member • Co-author of InterACT with Web Standards (Peachpit, due Spring)
  • 8. THINGS ARE GOOD BETWEEN US, XHTML, RIGHT? I MEAN. WE GET ALONG WELL. AND WE BOTH LIKE STUFF.
  • 9. “THE ATTEMPT TO GET THE WORLD TO SWITCH TO XML, INCLUDING QUOTES AROUND ATTRIBUTE VALUES AND SLASHES IN EMPTY TAGS AND NAMESPACES ALL AT ONCE DIDN'T WORK.” -SIR TIM BERNERS-LEE
  • 10. 5 % http://dev.opera.com/articles/view/mama-markup-validation-report/
  • 16. “TAKE CARE OF THE LUXURIES AND THE NECESSITIES WILL TAKE CARE OF THEMSELVES.” -FRANK LLOYD WRIGHT
  • 17. RELEARNING SYNTAX • Attribute quotes “not really” required • UPPERCASE and lowercase HTML elements allowed • So is CaMeLcAse typing. • No more need to do self-closing tags like <IMG /> or <BR /> • Also, no more minimalization. So, this is okay: <dl compact> • Basically, everything that was bad from HTML4 in XHTML5 is good again. • Full circle, baby!
  • 20. HTML 4.01 Transitional DTD: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> XHTML 1.0 Transitional DTD: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • 21. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>DOWNTOWN ORLANDO RESTAURANTS</title> </head> <body> <h1>....</h1> <p>...</p> </body> </html>
  • 22. EXERCISE • Goto HTML validator at http://validator.w3.org/#validate_by_input • Then type the following HTML (below) and hit validate: <!DOCTYPE html> <title>Small HTML5</title> <p>Hello world</p>
  • 25. BUILDING WITH HTML5
  • 26. DIV ID=”header” DIV ID=”nav” DIV ID=”section” DIV ID=”sidecolumn” DIV ID=”article” DIV ID=”footer”
  • 27. <HEADER> <NAV> <SECTION> <ASIDE> <ARTICLE> <FOOTER>
  • 28. <body> <header> <h1>Heading </h1> </header> <nav> <h3>Site Navigation</h3> <ul>...</ul> </nav> <section> <article> <h3>Weblog Entry</h3> </article> </section> <aside> <p>You are reading "Chocolate Rain", an entry posted on <time datetime="2009-03-05">5 March, 2009</time>, to the <a href="#">Misty collection</a>. See other posts in <a href="#">this collection</a>.</p> </aside> <footer> <p>...</p> </footer> </body>
  • 34. HEADER NAV SECTION ASIDE ARTICLE FOOTER
  • 37. LESSONS LEARNED • New HTML5 elements are treated as inline elements. • Need to use CSS declaration “display:block” • IE6and IE7 need to be nudged to recognize HTML elements in order to have CSS be applied • document.createElement(‘html5element’); • Dean Edwards IE7 script doesn’t help • There isn’t a jQuery plugin to make it “easier”
  • 38. LESSONS LEARNED • For Firefox 2 and Camino (Gecko 1.9) • HTML5 pages need to be served as XHTML • Content-Type: application/xhtml+xml; • ...Let the irony set for a bit.
  • 39. <?php if ( strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox/2.0') > -1) { header("Content-Type: application/xhtml+xml; charset=UTF-8"); echo'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">'; } else { echo '<!DOCTYPE html><html>'; }?> http://tr.im/h0Rj
  • 40. NEW HTML5 ELEMENTS • article • embed • nest • aside • event-source • output • audio • figure • progress • canvas • footer • source • command • header • time • datagrid • mark • video • datalist • meter • datatemplate • nav
  • 42. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Basic HTML5 Web Document Structure</title> </head> <body> <h1>Video Example</h1> <audio src="html5test.ogg" autoplay controls> <a href="html5test.ogg">Download audio</a> </audio> </body> </html>
  • 44. HTML5 AUDIO • AUDIO element attributes are SRC, AUTOBUFFER, AUTOPLAY, LOOP, CONTROLS • If you don’t have CONTROL, player becomes transparent
  • 45. HTML5 AUDIO SUPPORT FF3.5+ S4+ Ch3+ Op10+ Ogg Vorbis Y Y MP3 Y Y WAV Y Y Y
  • 46. SUPPORTING AUDIO <audio controls autobuffer> <source src="html5audio.mp3" /> <source src="html5audio.ogg" /> <!-- include Adobe Flash player EMBED and OBJECT code here --> </audio>
  • 47. SUPPORTING AUDIO • Ifyou do insert audio, setting the file to autoplay is not recommended, as it interferes with the experience for web surfers using screen readers. • Don’t use WAV file type. • Better to ship a compact disc to the user instead.
  • 49. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Basic HTML5 Web Document Structure</title> </head> <body> <h1>Video Example</h1> <object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ 4GuKSqAg5xI&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/4GuKSqAg5xI&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></ object> </body> </html>
  • 50. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Basic HTML5 Web Document Structure</title> </head> <body> <h1>Video Example</h1> <video src="html5test.ogg" width="320" height="240" controls poster="html5testvideoposter.jpg"> <a href="html5testvideo.ogg">Download movie</a> </video> </body> </html>
  • 51. VIDEO DEMO • Play the demo.
  • 52. HTML5 VIDEO • WIDTH and HEIGHT should be required, IMO, but movie plays anyway based on the values in the video file itself. • Video formats may have their own posterframe. The browser should use that by default unless overridden by valid POSTER attribute value. • Text can be included within VIDEO element to allow user to download video if their browser doesn’t support. • If you want to give users control, use CONTROL attribute.
  • 53. HTML5 VIDEO • Videocan start automatically if using the AUTOPLAY=”1” attribute and value. • Spec provides for LOOP, AUTOBUFFER which also take a value of O or 1. • Codecs support...
  • 54. HTML5 VIDEO “It would be helpful for interoperability if all browsers could support the same codecs. However, there are no known codecs that satisfy all the current players: we need a codec that is known to not require per-unit or per-distributor licensing, that is compatible with the open source development model, that is of sufficient quality as to be usable, and that is not an additional submarine patent risk for large companies. This is an ongoing issue and this section will be updated once more information is available.” - http://www.whatwg.org/specs/web-apps/current-work/#video- and-audio-codecs-for-video-elements
  • 55. CODECS • Ogg (or “Vorbis”) • No need to worry about patents • H.264 • Created by the MPEG group • If you have blu-ray disc player, you are using it
  • 56. CODEC SUPPORT FF3.5+ S Ch IE Ogg Y Y H.264 Y Y
  • 57. LESSONS LEARNED • Used VLC (http://www.videolan.org/vlc/) to encode common movie files types to OGG • People really, really, really want this to work, • However, feel like to support every file format will take a lot of time • If you are hot to trot for HTML5 Video, like, right now, check out Mark Pilgrim’s tutorial: http://diveintohtml5.org/video.html • Good primer: http://dev.opera.com/articles/view/introduction-html5-video/
  • 61. REPLACING ABBR • <ABBR> element is used by screenreaders to expand abbreviations like “lbs” or “NCAAP” • However unintended consequences occurred trying to workaround browser bugs for other HTML elements • What happens when a screenreaders text like this: • “Let’sgo to <abbr class="geo" title="30.300474;-97.747247">Austin, TX</abbr>” http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
  • 62. <div class="vevent"> <a class="url" href="http://www.web2con.com/">http:// www.web2con.com</a> <span class="summary">Web 2.0 Conference</span>: <abbr class="dtstart" title="2007-10-05">October 5</abbr>- <abbr class="dtend" title="2007-10-20">19</abbr>, at the <span class="location">Argent Hotel, San Francisco, CA</span> </div>
  • 63. <div class="vevent"> <a class="url" href="http://www.web2con.com/">http:// www.web2con.com</a> <span class="summary">Web 2.0 Conference</span>: <time class="dtstart" datetime="2007-10-05">October 5</time>- <time class="dtend" datetime="2007-10-20">19</time>, at the <span class="location">Argent Hotel, San Francisco, CA</span> </div> http://www.brucelawson.co.uk/2009/microformats-accessibility-html-5-again/
  • 64. POSTSCRIPT • <ABBR> issue has ben resolved with new pattern (dropping <ABBR> altogether): http://microformats.org/wiki/value-class-pattern • <p>Let’sgo to <span class="geo">51° 30' 48.45", -0° 8' 53.23" (<span class="value">51.513458;-0.14812</span>) </span></span> </p> • Thereby microformats doesn’t rely on any HTML5 elements, and • HTML5 spec isn’t looking to include microformats.
  • 66. <canvas id="myCanvas" width="300" height="150"> Fallback content, in case the browser does not support Canvas. </canvas>
  • 67. <script type="text/javascript"><!-- window.addEventListener('load', function () { // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } // Now you are done! Let's draw a blue rectangle. context.fillStyle = '#00f'; context.fillRect(0, 0, 150, 100); }, false); // --></script>
  • 69. // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } context.fillStyle = '#00f'; context.strokeStyle = '#f00'; context.lineWidth = 4; // Draw a right triangle. context.beginPath(); context.moveTo(10, 10); context.lineTo(100, 10); context.lineTo(10, 100); context.lineTo(10, 10); context.fill(); context.stroke(); context.closePath(); }, false);
  • 71. // Get the canvas element. var elem = document.getElementById('myCanvas'); if (!elem || !elem.getContext) { return; } // Get the canvas 2d context. var context = elem.getContext('2d'); if (!context) { return; } context.fillStyle = '#00f'; context.strokeStyle = '#f00'; context.lineWidth = 4; // Draw a right triangle. context.beginPath(); context.moveTo(10, 10); context.lineTo(100, 10); context.lineTo(10, 100); context.lineTo(10, 10); context.fill(); context.stroke(); context.closePath(); }, false);
  • 75. <table > <caption>My Push Ups</caption> <thead> <tr> <td></td> <th>M</th> <th>Tu</th> <th>W</th> <th>Th</th> <th>F</th> <th>Sa</th> </tr> </thead> <tbody> <tr> <th>Chris</th> <td>56</td> <td>30</td> <td>50</td> <td>0</td> <td>45</td> <td>120</td> <td>0</td> </tr> </tbody> </table>
  • 77. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/1.3.2/jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></ script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 78. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http:// ajax.googleapis.com/ajax/libs/jquery/1.3.2/ jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></ script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 79. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/1.3.2/jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 81. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/1.3.2/jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></ script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 82. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/1.3.2/jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></ script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 83. table.accessHide { position: absolute; left: -999999px; } table { height: 100px; width: 250px;}
  • 84. <link type="text/css" rel="stylesheet" href="visualize.jQuery.css"/> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/ jquery/1.3.2/jquery.min.js"></script> <!--[if IE]><script type="text/javascript" src="excanvas.compiled.js"></ script><![endif]--> <script type="text/javascript" src="visualize.jQuery.js"></script> <script type="text/javascript"> $(function(){ $('table').addClass('accessHide'); $('table').visualize({type: 'line', colors: ['#fff']}); }); </script>
  • 87. QUICK INTERMISSION http://tr.im/Pjzy
  • 88. HTML5 & LOCAL DATABASE, APP CACHE, GEOLOCATION, YOUR PHONE
  • 90. DATABASE, APP CACHE, GEOLOCATION LINKS • W3C HTML5 Database Storage Specification: http://tr.im/h13y • W3C Geolocation API Specification: http://tr.im/h12L • W3C HTML5 Offline Web Applications: http://tr.im/h12z • Safari Dev Connection on HTML5 Offline Application Cache: http://tr.im/h12f • WebKit Does HTML5 Client-Side Storage: http://tr.im/h140
  • 91. “HTML 5 IS A KLUDGE.” - BRUCE LAWSON
  • 93. CAN HTML5 TELL US WHAT’S FOR DINNER?
  • 95. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Downtown Orlando Restaurants</title> <!--[if IE8]> <script src="http://html5shiv.googlecode.com/svn/ trunk/html5.js"></script> <![endif]-->
  • 96. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Downtown Orlando Restaurants</title> <!--[if IE]> <script src="http:// html5shiv.googlecode.com/svn/trunk/ html5.js"></script> <![endif]-->
  • 98. <div id="" class="vcard"> <a class="url fn n" href="http://www.310lakeside.net"> <span class="given-name">Joanne</span> <span class="additional-name"></span> <span class="family-name">Smith</span> </a> <div class="org">310 Lakeside</div> <div class="adr"> <div class="street-address">301 East Pine Street</div> <span class="locality">Orlando</span>, <span class="region">FL</span>, <span class="postal-code">32801</span> <span class="country-name">USA</span> </div> <div class="tel">(407) 447-9310</div> <div class="note distance"> </div> </div>
  • 102. <a href=”http://h2vx.com/vcf/example.com/ page.html”>Download contacts</a>
  • 104. GREAT, HTML5, BUT I’M HUNGRY NOW.
  • 105. <script src="http://www.google.com/jsapi? key=yourkeygoeshere"></script> <script> google.load("maps", "3",{"other_params":"sensor=true"}); google.load("jquery", "1"); </script>
  • 106. if (navigator && navigator.geolocation) { // HTML5 GeoLocation function getLocation(position) { updateMyLocation(position.coords.latitude,position.coords.lo ngitude); proccessDirections.sortLocations( position.coords.latitude, position.coords.longitude ); } navigator.geolocation.getCurrentPosition(getLocation);
  • 108. } else { // Google AJAX API fallback GeoLocation if ((typeof google == 'object') && google.loader && google.loader.ClientLocation) { updateMyLocation(google.loader.ClientLocation.latitude,googl e.loader.ClientLocation.longitude); proccessDirections.sortLocations( google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude ); } } }
  • 110. addresses = $(locations).map(function(){ var $adr = $(this).find(".adr"), latLng = null, lat, lng;
  • 111. WHAT NEXT? • Check your current location against the addresses in your listing. • Withtwo points, we can determine the distance between where I am and where the food is located. • With a list of values, I can sort those addresses based on the fewest amount of travel (did I mention I was hungry now?) •I can then also mention HOW far those distances are, too.
  • 113. BUT WAIT.... • There are a lot of restaurants in the list. • To go back and forth for geoencoding the addresses will take time. • Wouldn’t there be a faster way, if I had the time, to bypass that?
  • 114. <div id="" class="vcard"> <a class="url fn n" href="http://www.tmh.com/"> <span class="given-name">John</span> <span class="additional-name"></span> <span class="family-name">Smith</span> </a> <div class="org">Tallahassee Memorial Hospital</div> <div class="adr" data-longitude="-84.260799" data-latitude="30.456100" data-lang="js"> <div class="street-address">1300 Miccosukee Road</div> <span class="locality">Tallahassee</span>, <span class="region">FL</span> <span class="country-name">USA</span> </div> <div class="tel">(850) 431-1155</div> </div> http://ejohn.org/blog/html-5-data-attributes/
  • 115. if ((lat = $adr.attr("data-latitude")) && (lng = $adr.attr("data-longitude"))) { latLng = new google.maps.LatLng(lat,lng); }
  • 116. BUT WAIT.... •I own an iPhone!
  • 120. THANK YOU! Christopher Schmitt schmitt@heatvision.com http://twitter.com/@teleject
  • 121. Creative Commons Citations http://www.flickr.com/photos/gurock20/459901107/ http://www.flickr.com/photos/wili/214317898/ http://www.flickr.com/photos/gadl/421838292/ http://www.flickr.com/photos/tantek/1141384818/ http://dev.opera.com/articles/view/html-5-canvas-the-basics/