SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
HTML5 Essentials
        by Marc Grabanski
‱ Less Header Code
‱ More Semantic HTML tags
‱ Media Tags
‱ Geolocation
‱ Canvas
‱ Input Types
‱ Form Validation
‱ Draggable
‱ Local Storage
‱ Cross-Domain Messaging
‱ Web Sockets
‱ Eventually, 3D canvas
Less Header Code

<!DOCTYPE HTML>
<html>
<head>
  <meta charset=”utf-8”>
  <title>foo</title>
</head>
...
No need for type attribute

<script src=”foo.js”>
</script>

<link href=”foo.css”></link>
More Semantic HTML tags
           <div id=”header”>

             <div id=”nav”>

 <div id=”article”>    <div id=”sidebar”>




           <div id=”footer”>
More Semantic HTML tags
              <header>

               <nav>

 <section>               <aside>

  <article>




              <footer>
Fix IE for HTML5 elements

document.createElement(‘header’);
HTML5 Shiv
<!--[if lte IE 8]>
<script src="http://html5shiv.googlecode.com/
svn/trunk/ html5.js"></script>
<![endif]-->

or the more advanced


http://www.modernizr.com
Output
<output name="result"></output>
Progress
<progress id="p" max=100><span>0</span>%</progress>
Progress in Action
<p>Progress: <progress id="p" max=100><span>0</span>%</
progress></p>
 <script>
  var progressBar = document.getElementById('p');
  function updateProgress(newValue) {
    progressBar.value = newValue;
    progressBar.getElementsByTagName('span')[0].textContent =
newValue;
  }
 </script>
Progress is for status of a set of tasks

Meter is for a gauge of measure
Meter

Storage space usage:
<meter value=6 max=8>6 blocks used (out of 8 total)
</meter>

Voter turnout:
<meter value=0.75><img alt="75%"
src="graph75.png"></meter>

Tickets sold:
<meter min="0" max="100" value="75"></meter>
Details and Summary
<details>
 <summary>Copying... <progress max="375505392"
value="97543282"></progress> 25%</summary>
 <dl>
  <dt>Transfer rate:</dt> <dd>452KB/s</dd>
  <dt>Local filename:</dt> <dd>/home/rpausch/raycd.m4v</dd>
  <dt>Remote filename:</dt> <dd>/var/www/lectures/raycd.m4v</dd>
  <dt>Duration:</dt> <dd>01:16:27</dd>
  <dt>Color profile:</dt> <dd>SD (6-1-6)</dd>
  <dt>Dimensions:</dt> <dd>320×240</dd>
 </dl>
</details>
Address

<address>
 <a href="../People/Raggett/">Dave Raggett</A>,
 <a href="../People/Arnaud/">Arnaud Le Hors</A>,
 contacts for the w3c HTML activity
</address>


Address applies to the nearest Article or Body tag.
Data Attributes
<div class="spaceship" data-ship-id="92432"
   data-weapons="laser 2" data-shields="50%"
   data-x="30" data-y="10" data-z="90">
 <button class="fire">
</div>

<script>
div = document.getElementsByTagName(‘ div’)[0];
spaceships[div.dataset.shipId].fire()
</script>
Section
<article>
<hgroup>
 <h1>Apples</h1>
 <h2>Tasty, delicious fruit!</h2>
</hgroup>
<p>The apple is the pomaceous fruit of the apple tree.</p>
<section>
 <h1>Red Delicious</h1>
 <p>These bright red apples are the most common found in many
 supermarkets.</p>
</section>
<section>
 <h1>Granny Smith</h1>
 <p>These juicy, green apples make a great filling for
 apple pies.</p>
</section>
</article>
Good
       <body>
        <h4>Apples</h4>
        <p>Apples are fruit.</p>
        <section>
        <h2>Taste</h2>
        <p>They taste lovely.</p>
        <h6>Sweet</h6>
        <p>Red apples are sweeter</p>
        <h1>Color</h1>
        <p>Apples come in various
       colors.</p>
        </section>
       </body>
Better
         <body>
          <h1>Apples</h1>
          <p>Apples are fruit.</p>
          <section>
          <h2>Taste</h2>
          <p>They taste lovely.</p>
          <section>
           <h3>Sweet</h3>
           <p>Red apples are sweeter</p>
          </section>
          </section>
          <section>
          <h2>Color</h2>
          <p>Apples come in various colors.</p>
          </section>
         </body>
Figure and Figure Caption

<figure>
 <img src="bubbles-work.jpeg"
    alt="Bubbles, sitting in his office chair, works on his
       latest project intently.">
<figcaption>Bubbles at work</figcaption>
</figure>
Figure and Figure Caption
<p>In <a href="#l4">listing 4</a> we see the primary
core interface
API declaration.</p>
<figure id="l4">
 <figcaption>Listing 4. The primary core interface API
declaration.</figcaption>
 <pre><code>interface PrimaryCore {
 boolean verifyDataLine();
 void sendData(in sequence&lt;byte> data);
 void initSelfDestruct();
}</code></pre>
</figure>
Time and Publish Date Attribute
<time pubdate datetime="2009-10-09T14:28-08:00"></time>
<article>
 <header>
  <h1>The Very First Rule of Life</h1>
  <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p>
 </header>
 <p>If there's a microphone anywhere near you, assume it's hot and
 sending whatever you're saying to the world. Seriously.</p>
 <p>...</p>
 <section>
  <h1>Comments</h1>
  <article>
  <footer>
   <p>Posted by: George Washington</p>
   <p><time pubdate datetime="2009-10-10T19:10-08:00"></time></p>
  </footer>
  <p>Yeah! Especially when talking about your lobbyist friends!</p>
  </article>
  <article>
  <footer>
   <p>Posted by: George Hammond</p>
   <p><time pubdate datetime="2009-10-10T19:15-08:00"></time></p>
  </footer>
  <p>Hey, you have the same first name as me.</p>
  </article>
 </section>
</article>
Breadcrumb Navigation
<nav>
 <p>
 <a href="/" rel="index up up up">Main</a> >
 <a href="/products/" rel="up up">Products</a> >
 <a href="/products/dishwashers/" rel="up">Dishwashers</a> >
 <a>Second hand</a>
 </p>
 <p>
 <a href="/" rel="index up up">Main</a> >
 <a href="/second-hand/" rel="up">Second hand</a> >
 <a>Dishwashers</a>
 </p>
</nav>



Similarly, pagination can be done with
first, last, next and prev
Menu and Command

<menu type="toolbar">
<command type="radio" radiogroup="alignment" checked="checked"
     label="Left" icon="icons/alL.png" onclick="setAlign('left')">
<command type="radio" radiogroup="alignment"
     label="Center" icon="icons/alC.png" onclick="setAlign('center')">
<command type="radio" radiogroup="alignment"
     label="Right" icon="icons/alR.png" onclick="setAlign('right')">
<hr>
<command type="command" disabled
     label="Publish" icon="icons/pub.png" onclick="publish()">
</menu>
Menu (continued)
 <menu type="toolbar">
 <li>
 <menu label="File">
  <button type="button" onclick="fnew()">New...</button>
  <button type="button" onclick="fopen()">Open...</button>
  <button type="button" onclick="fsave()">Save</button>
  <button type="button" onclick="fsaveas()">Save as...</button>
 </menu>
 </li>
 <li>
 <menu label="Edit">
  <button type="button" onclick="ecopy()">Copy</button>
  <button type="button" onclick="ecut()">Cut</button>
  <button type="button" onclick="epaste()">Paste</button>
 </menu>
 </li>
 <li>
 <menu label="Help">
  <li><a href="help.html">Help</a></li>
  <li><a href="about.html">About</a></li>
 </menu>
 </li>
 </menu>
Mark is highlighting something
<p><mark>Momentum is preserved across the wormhole.
Electromagnetic
radiation can travel in both directions through a wormhole,
but matter cannot.</mark></p>


  Strong is different, denotes importance
<p>When a wormhole is created, a vortex normally forms.
<strong>Warning: The vortex caused by the wormhole opening
will
annihilate anything in its path.</strong> Vortexes can be avoide
when
using sufficiently advanced dialing technology.</p>
Not all Navigation should use <nav>

          <nav></nav>

only main navigation, for instance
footer nav is secondary
Article is unique content to the page.

       <article></article>
Hgroup, highest rank group of headings

        <hgroup></hgroup>
Itemscope and Itemprop

  <div itemscope>
  <p>My name is <span itemprop="name">Elizabeth</span>.</p>
  </div>

  <div itemscope>
  <p>My name is <span itemprop="name">Daniel</span>.</p>
  </div>

  <div itemscope>
   <p>My name is <span itemprop="name">Neil</span>.</p>
   <p>My band is called <span itemprop="band">Four Parts Water</
  span>.</p>
   <p>I am <span itemprop="nationality">British</span>.</p>
  </div>
Media Tags

<video src=” cat.ogg” />

add native controls
<video src=”cat.ogg” controls />
Media Tags


<video controls/>
 <source src=”cat.mp4” />
 <source src=”cat.ogg” />
</video>




http://camendesign.com/code/video_for_everybody
Video Format Support

Ogg Theora/Voribs

 - Firefox 3.5+
 - Chrome
 - Opera

MPEG-4 H.264/AAC

 - Safari
 - Chrome
 - Opera
Native Video          Fallback with Flash
- Safari (v4.0.4+)
- Google Chrome (v4.0+)
- Firefox (v3.6+)

 http://jilion.com/sublime/video
Media Tags

<audio src=”test.ogg”></audio>

<audio src=”test.ogg” autoplay controls loop>
 <a href=”test.ogg”>download</a>
</audio>
Native GeoLocation

navigator.geolocation.getCurrentPosition(
   function(position){
     position.coords.latitude,
     position.coords.longitude
   }
);
GeoLocation w/ Google Ajax API fallback
   if (navigator && navigator.geolocation) {
     // HTML5 GeoLocation
     function getLocation(position) {
       proccessDirections.sortLocations(
         position.coords.latitude,
         position.coords.longitude
       );
     }
     navigator.geolocation.getCurrentPosition(getLocation);
   } else {
     // Google AJAX API fallback GeoLocation
     if ((typeof google == 'object') && google.loader &&
google.loader.ClientLocation) {
       proccessDirections.sortLocations(
         google.loader.ClientLocation.latitude,
         google.loader.ClientLocation.longitude
       );
     }
   }
Canvas

<canvas id=”square”>
 fallback content
</canvas>

<script>
canvas = canvas.getElementById(‘square’);
context = canvas.getContext(‘2d’);
context.fillStyle = “#000000”;
context.fillRect(0, 0, 100, 100);
</script>
Canvas Internet Explorer Support

ExplorerCanvas
http://code.google.com/p/explorercanvas/
Input Types

   <input type=”email” />

    tel          datetime
    search       date
    email        range
    url          color

Unsupported browsers default to text.
Input Types
Input type changes keyboard on iphone.
Input Type Range
Input Type Range + Datalist

<input type="range" min="-100" max="100"
value="0" step="10" name="power" list="powers">
<datalist id="powers">
 <option value="0">
 <option value="-30">
 <option value="30">
 <option value="+50">
</datalist>
Input Type Number + Output

<input name=a type=number step=any> +
 <input name=b type=number step=any> =
 <output onforminput="value = a.value + b.value"></output>
File Upload Multiple


   <input type=file multiple>
Input Type Email + Multiple


<label>Cc: <input type=email multiple name=cc></label>
Datalist

<label>Homepage: <input name=hp type=url list=hpurls></label>
<datalist id=hpurls>
 <option value="http://www.google.com/" label="Google">
 <option value="http://www.reddit.com/" label="Reddit">
</datalist>
Form Validation


<input name="custname" required>

<script>
form.checkValidity();
</script>
Custom Validation

<label>Feeling: <input name=f type="text" oninput="check(this)"></label>
<script>
 function check(input) {
   if (input.value == "good" ||
       input.value == "fine" ||
       input.value == "tired") {
     input.setCustomValidity('"' + input.value + '" is not a feeling.');
   } else {
     // input is fine -- reset the error message
     input.setCustomValidity('');
   }
 }
</script>
Storage


sessionStorage.setItem(key, value);
sessionStorage.getItem(key);

localStorage.setItem(key, value);
localStorage.getItem(key);
Local Storage in Yahoo! Search Pad
Local Storage in Yahoo! Search Pad




    http://www.jstorage.info/
Application Storage / Offline


<html manifest=”cache.manifest”>

detect online or offline

window.addEventListener('online', online, true);
window.addEventListener('offline', online, true);
Draggable

<div draggable=”true”></div>

addEvent(div, “dragstart”, function(e){
  e.dataTransfer.setData(‘foo’, ‘bar’);
}, true);

addEvent(div, ‘dragend’, function(e){
  e.dataTransfer.getData(‘foo’);
}, true);
Cross Domain Messaging


postMessage(string);

onMessage(event) {
  event.data;
}
Editable Content

Turn an element into an editable area.
<script>
 document.getElementsByTagName('p')[0].contentEditable = true;
</script>
Web Sockets
var ws = new WebSocket("ws://hostname:80/");
ws.onmessage = function (event) {
  event.data
};
ws.onclose = function () {};
ws.onopen = function () {};
Web Worker


new Worker("worker.js");


- Don’t have access to DOM or page.
- Have to communicate through postMessage API
http://html5demos.com/
Web GL

                   3D O3D
http://www.youtube.com/watch?v=uofWfXOzX-g
Questions?

Marc Grabanski:
http://marcgrabanski.com

User interface and web application
development.
Examples: http://mjgin.com/work.html

Twitter: http://twitter.com/1Marc
Email: m@marcgrabanski.com

Weitere Àhnliche Inhalte

Was ist angesagt?

How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes WorkHandsOnWP.com
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_androidPRITI TELMORE
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3Doris Chen
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)webhostingguy
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Devang Garach
 
web server
web serverweb server
web servernava rathna
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JSArno Lordkronos
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Gil Fink
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)AakankshaR
 
Files in php
Files in phpFiles in php
Files in phpsana mateen
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )Ahmed Emad
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS BasicsMai Moustafa
 

Was ist angesagt? (20)

How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes Work
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
 
Introduction to CSS3
Introduction to CSS3Introduction to CSS3
Introduction to CSS3
 
Web Servers (ppt)
Web Servers (ppt)Web Servers (ppt)
Web Servers (ppt)
 
Html5
Html5 Html5
Html5
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
 
Css selectors
Css selectorsCss selectors
Css selectors
 
Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7Fundamental of Node.JS - Internship Presentation - Week7
Fundamental of Node.JS - Internship Presentation - Week7
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
web server
web serverweb server
web server
 
Java script
Java scriptJava script
Java script
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Css
CssCss
Css
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)Cascading Style Sheet (CSS)
Cascading Style Sheet (CSS)
 
Files in php
Files in phpFiles in php
Files in php
 
Bootstrap
BootstrapBootstrap
Bootstrap
 
MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )MVVM ( Model View ViewModel )
MVVM ( Model View ViewModel )
 
HTML CSS Basics
HTML CSS BasicsHTML CSS Basics
HTML CSS Basics
 
Css pseudo-classes
Css pseudo-classesCss pseudo-classes
Css pseudo-classes
 

Ähnlich wie HTML5 Essentials

TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–ź
TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–źTOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–ź
TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–źć‰æ Œ 高
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1Robert Nyman
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranRobert Nyman
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupaldrubb
 
慳äșŽ Html5 那ç‚čäș‹
慳äșŽ Html5 那ç‚čäș‹ć…łäșŽ Html5 那ç‚čäș‹
慳äșŽ Html5 那ç‚čäș‹Sofish Lin
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5Robert Nyman
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5Pablo Garaizar
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5Kevin DeRudder
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5Steven Chipman
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Mandakini Kumari
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web componentsMarc BĂ€chinger
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2James Pearce
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5www.netgains.org
 
Repaso rĂĄpido a los nuevos estĂĄndares web
Repaso rĂĄpido a los nuevos estĂĄndares webRepaso rĂĄpido a los nuevos estĂĄndares web
Repaso rĂĄpido a los nuevos estĂĄndares webPablo Garaizar
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoRob Bontekoe
 

Ähnlich wie HTML5 Essentials (20)

TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–ź
TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–źTOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–ź
TOSSUG HTML5 èź€æ›žæœƒ æ–°æš™ç±€èˆ‡èĄšć–ź
 
HTML5 workshop, part 1
HTML5 workshop, part 1HTML5 workshop, part 1
HTML5 workshop, part 1
 
HTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - AltranHTML5, The Open Web, and what it means for you - Altran
HTML5, The Open Web, and what it means for you - Altran
 
HTML5 - Pedro Rosa
HTML5 - Pedro RosaHTML5 - Pedro Rosa
HTML5 - Pedro Rosa
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupal
 
慳äșŽ Html5 那ç‚čäș‹
慳äșŽ Html5 那ç‚čäș‹ć…łäșŽ Html5 那ç‚čäș‹
慳äșŽ Html5 那ç‚čäș‹
 
An Introduction To HTML5
An Introduction To HTML5An Introduction To HTML5
An Introduction To HTML5
 
Introduccion a HTML5
Introduccion a HTML5Introduccion a HTML5
Introduccion a HTML5
 
html5
html5html5
html5
 
What you need to know bout html5
What you need to know bout html5What you need to know bout html5
What you need to know bout html5
 
The Devil and HTML5
The Devil and HTML5The Devil and HTML5
The Devil and HTML5
 
HTML5
HTML5HTML5
HTML5
 
HTML5
HTML5HTML5
HTML5
 
An Introduction to HTML5
An Introduction to HTML5An Introduction to HTML5
An Introduction to HTML5
 
Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)Html5 drupal7 with mandakini kumari(1)
Html5 drupal7 with mandakini kumari(1)
 
Introduction to web components
Introduction to web componentsIntroduction to web components
Introduction to web components
 
HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2HTML5 and the dawn of rich mobile web applications pt 2
HTML5 and the dawn of rich mobile web applications pt 2
 
Introduction to Html5
Introduction to Html5Introduction to Html5
Introduction to Html5
 
Repaso rĂĄpido a los nuevos estĂĄndares web
Repaso rĂĄpido a los nuevos estĂĄndares webRepaso rĂĄpido a los nuevos estĂĄndares web
Repaso rĂĄpido a los nuevos estĂĄndares web
 
Building iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" DominoBuilding iPhone Web Apps using "classic" Domino
Building iPhone Web Apps using "classic" Domino
 

Mehr von Marc Grabanski

CSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsCSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsMarc Grabanski
 
Free vs Paid Content
Free vs Paid ContentFree vs Paid Content
Free vs Paid ContentMarc Grabanski
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllMarc Grabanski
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Marc Grabanski
 
jQTouch and Titanium
jQTouch and TitaniumjQTouch and Titanium
jQTouch and TitaniumMarc Grabanski
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and PluginsMarc Grabanski
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery PluginsMarc Grabanski
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery EssentialsMarc Grabanski
 

Mehr von Marc Grabanski (8)

CSS/SVG Matrix Transforms
CSS/SVG Matrix TransformsCSS/SVG Matrix Transforms
CSS/SVG Matrix Transforms
 
Free vs Paid Content
Free vs Paid ContentFree vs Paid Content
Free vs Paid Content
 
Introduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for AllIntroduction to jQuery Mobile - Web Deliver for All
Introduction to jQuery Mobile - Web Deliver for All
 
Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)Whirlwind Tour of SVG (plus RaphaelJS)
Whirlwind Tour of SVG (plus RaphaelJS)
 
jQTouch and Titanium
jQTouch and TitaniumjQTouch and Titanium
jQTouch and Titanium
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
Learning from the Best jQuery Plugins
Learning from the Best jQuery PluginsLearning from the Best jQuery Plugins
Learning from the Best jQuery Plugins
 
jQuery Essentials
jQuery EssentialsjQuery Essentials
jQuery Essentials
 

KĂŒrzlich hochgeladen

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 

KĂŒrzlich hochgeladen (20)

Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 

HTML5 Essentials

  • 1. HTML5 Essentials by Marc Grabanski
  • 2. ‱ Less Header Code ‱ More Semantic HTML tags ‱ Media Tags ‱ Geolocation ‱ Canvas ‱ Input Types ‱ Form Validation ‱ Draggable ‱ Local Storage ‱ Cross-Domain Messaging ‱ Web Sockets ‱ Eventually, 3D canvas
  • 3. Less Header Code <!DOCTYPE HTML> <html> <head> <meta charset=”utf-8”> <title>foo</title> </head> ...
  • 4. No need for type attribute <script src=”foo.js”> </script> <link href=”foo.css”></link>
  • 5. More Semantic HTML tags <div id=”header”> <div id=”nav”> <div id=”article”> <div id=”sidebar”> <div id=”footer”>
  • 6. More Semantic HTML tags <header> <nav> <section> <aside> <article> <footer>
  • 7. Fix IE for HTML5 elements document.createElement(‘header’);
  • 8. HTML5 Shiv <!--[if lte IE 8]> <script src="http://html5shiv.googlecode.com/ svn/trunk/ html5.js"></script> <![endif]--> or the more advanced http://www.modernizr.com
  • 11. Progress in Action <p>Progress: <progress id="p" max=100><span>0</span>%</ progress></p> <script> var progressBar = document.getElementById('p'); function updateProgress(newValue) { progressBar.value = newValue; progressBar.getElementsByTagName('span')[0].textContent = newValue; } </script>
  • 12. Progress is for status of a set of tasks Meter is for a gauge of measure
  • 13. Meter Storage space usage: <meter value=6 max=8>6 blocks used (out of 8 total) </meter> Voter turnout: <meter value=0.75><img alt="75%" src="graph75.png"></meter> Tickets sold: <meter min="0" max="100" value="75"></meter>
  • 14. Details and Summary <details> <summary>Copying... <progress max="375505392" value="97543282"></progress> 25%</summary> <dl> <dt>Transfer rate:</dt> <dd>452KB/s</dd> <dt>Local filename:</dt> <dd>/home/rpausch/raycd.m4v</dd> <dt>Remote filename:</dt> <dd>/var/www/lectures/raycd.m4v</dd> <dt>Duration:</dt> <dd>01:16:27</dd> <dt>Color profile:</dt> <dd>SD (6-1-6)</dd> <dt>Dimensions:</dt> <dd>320×240</dd> </dl> </details>
  • 15. Address <address> <a href="../People/Raggett/">Dave Raggett</A>, <a href="../People/Arnaud/">Arnaud Le Hors</A>, contacts for the w3c HTML activity </address> Address applies to the nearest Article or Body tag.
  • 16. Data Attributes <div class="spaceship" data-ship-id="92432" data-weapons="laser 2" data-shields="50%" data-x="30" data-y="10" data-z="90"> <button class="fire"> </div> <script> div = document.getElementsByTagName(‘ div’)[0]; spaceships[div.dataset.shipId].fire() </script>
  • 17. Section <article> <hgroup> <h1>Apples</h1> <h2>Tasty, delicious fruit!</h2> </hgroup> <p>The apple is the pomaceous fruit of the apple tree.</p> <section> <h1>Red Delicious</h1> <p>These bright red apples are the most common found in many supermarkets.</p> </section> <section> <h1>Granny Smith</h1> <p>These juicy, green apples make a great filling for apple pies.</p> </section> </article>
  • 18. Good <body> <h4>Apples</h4> <p>Apples are fruit.</p> <section> <h2>Taste</h2> <p>They taste lovely.</p> <h6>Sweet</h6> <p>Red apples are sweeter</p> <h1>Color</h1> <p>Apples come in various colors.</p> </section> </body>
  • 19. Better <body> <h1>Apples</h1> <p>Apples are fruit.</p> <section> <h2>Taste</h2> <p>They taste lovely.</p> <section> <h3>Sweet</h3> <p>Red apples are sweeter</p> </section> </section> <section> <h2>Color</h2> <p>Apples come in various colors.</p> </section> </body>
  • 20. Figure and Figure Caption <figure> <img src="bubbles-work.jpeg" alt="Bubbles, sitting in his office chair, works on his latest project intently."> <figcaption>Bubbles at work</figcaption> </figure>
  • 21. Figure and Figure Caption <p>In <a href="#l4">listing 4</a> we see the primary core interface API declaration.</p> <figure id="l4"> <figcaption>Listing 4. The primary core interface API declaration.</figcaption> <pre><code>interface PrimaryCore { boolean verifyDataLine(); void sendData(in sequence&lt;byte> data); void initSelfDestruct(); }</code></pre> </figure>
  • 22. Time and Publish Date Attribute <time pubdate datetime="2009-10-09T14:28-08:00"></time>
  • 23. <article> <header> <h1>The Very First Rule of Life</h1> <p><time pubdate datetime="2009-10-09T14:28-08:00"></time></p> </header> <p>If there's a microphone anywhere near you, assume it's hot and sending whatever you're saying to the world. Seriously.</p> <p>...</p> <section> <h1>Comments</h1> <article> <footer> <p>Posted by: George Washington</p> <p><time pubdate datetime="2009-10-10T19:10-08:00"></time></p> </footer> <p>Yeah! Especially when talking about your lobbyist friends!</p> </article> <article> <footer> <p>Posted by: George Hammond</p> <p><time pubdate datetime="2009-10-10T19:15-08:00"></time></p> </footer> <p>Hey, you have the same first name as me.</p> </article> </section> </article>
  • 24. Breadcrumb Navigation <nav> <p> <a href="/" rel="index up up up">Main</a> > <a href="/products/" rel="up up">Products</a> > <a href="/products/dishwashers/" rel="up">Dishwashers</a> > <a>Second hand</a> </p> <p> <a href="/" rel="index up up">Main</a> > <a href="/second-hand/" rel="up">Second hand</a> > <a>Dishwashers</a> </p> </nav> Similarly, pagination can be done with first, last, next and prev
  • 25. Menu and Command <menu type="toolbar"> <command type="radio" radiogroup="alignment" checked="checked" label="Left" icon="icons/alL.png" onclick="setAlign('left')"> <command type="radio" radiogroup="alignment" label="Center" icon="icons/alC.png" onclick="setAlign('center')"> <command type="radio" radiogroup="alignment" label="Right" icon="icons/alR.png" onclick="setAlign('right')"> <hr> <command type="command" disabled label="Publish" icon="icons/pub.png" onclick="publish()"> </menu>
  • 26. Menu (continued) <menu type="toolbar"> <li> <menu label="File"> <button type="button" onclick="fnew()">New...</button> <button type="button" onclick="fopen()">Open...</button> <button type="button" onclick="fsave()">Save</button> <button type="button" onclick="fsaveas()">Save as...</button> </menu> </li> <li> <menu label="Edit"> <button type="button" onclick="ecopy()">Copy</button> <button type="button" onclick="ecut()">Cut</button> <button type="button" onclick="epaste()">Paste</button> </menu> </li> <li> <menu label="Help"> <li><a href="help.html">Help</a></li> <li><a href="about.html">About</a></li> </menu> </li> </menu>
  • 27. Mark is highlighting something <p><mark>Momentum is preserved across the wormhole. Electromagnetic radiation can travel in both directions through a wormhole, but matter cannot.</mark></p> Strong is different, denotes importance <p>When a wormhole is created, a vortex normally forms. <strong>Warning: The vortex caused by the wormhole opening will annihilate anything in its path.</strong> Vortexes can be avoide when using sufficiently advanced dialing technology.</p>
  • 28. Not all Navigation should use <nav> <nav></nav> only main navigation, for instance footer nav is secondary
  • 29. Article is unique content to the page. <article></article>
  • 30. Hgroup, highest rank group of headings <hgroup></hgroup>
  • 31. Itemscope and Itemprop <div itemscope> <p>My name is <span itemprop="name">Elizabeth</span>.</p> </div> <div itemscope> <p>My name is <span itemprop="name">Daniel</span>.</p> </div> <div itemscope> <p>My name is <span itemprop="name">Neil</span>.</p> <p>My band is called <span itemprop="band">Four Parts Water</ span>.</p> <p>I am <span itemprop="nationality">British</span>.</p> </div>
  • 32. Media Tags <video src=” cat.ogg” /> add native controls <video src=”cat.ogg” controls />
  • 33. Media Tags <video controls/> <source src=”cat.mp4” /> <source src=”cat.ogg” /> </video> http://camendesign.com/code/video_for_everybody
  • 34. Video Format Support Ogg Theora/Voribs - Firefox 3.5+ - Chrome - Opera MPEG-4 H.264/AAC - Safari - Chrome - Opera
  • 35. Native Video Fallback with Flash - Safari (v4.0.4+) - Google Chrome (v4.0+) - Firefox (v3.6+) http://jilion.com/sublime/video
  • 36. Media Tags <audio src=”test.ogg”></audio> <audio src=”test.ogg” autoplay controls loop> <a href=”test.ogg”>download</a> </audio>
  • 37. Native GeoLocation navigator.geolocation.getCurrentPosition( function(position){ position.coords.latitude, position.coords.longitude } );
  • 38. GeoLocation w/ Google Ajax API fallback if (navigator && navigator.geolocation) { // HTML5 GeoLocation function getLocation(position) { proccessDirections.sortLocations( position.coords.latitude, position.coords.longitude ); } navigator.geolocation.getCurrentPosition(getLocation); } else { // Google AJAX API fallback GeoLocation if ((typeof google == 'object') && google.loader && google.loader.ClientLocation) { proccessDirections.sortLocations( google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude ); } }
  • 39. Canvas <canvas id=”square”> fallback content </canvas> <script> canvas = canvas.getElementById(‘square’); context = canvas.getContext(‘2d’); context.fillStyle = “#000000”; context.fillRect(0, 0, 100, 100); </script>
  • 40. Canvas Internet Explorer Support ExplorerCanvas http://code.google.com/p/explorercanvas/
  • 41. Input Types <input type=”email” /> tel datetime search date email range url color Unsupported browsers default to text.
  • 42. Input Types Input type changes keyboard on iphone.
  • 44. Input Type Range + Datalist <input type="range" min="-100" max="100" value="0" step="10" name="power" list="powers"> <datalist id="powers"> <option value="0"> <option value="-30"> <option value="30"> <option value="+50"> </datalist>
  • 45. Input Type Number + Output <input name=a type=number step=any> + <input name=b type=number step=any> = <output onforminput="value = a.value + b.value"></output>
  • 46. File Upload Multiple <input type=file multiple>
  • 47. Input Type Email + Multiple <label>Cc: <input type=email multiple name=cc></label>
  • 48. Datalist <label>Homepage: <input name=hp type=url list=hpurls></label> <datalist id=hpurls> <option value="http://www.google.com/" label="Google"> <option value="http://www.reddit.com/" label="Reddit"> </datalist>
  • 49. Form Validation <input name="custname" required> <script> form.checkValidity(); </script>
  • 50. Custom Validation <label>Feeling: <input name=f type="text" oninput="check(this)"></label> <script> function check(input) { if (input.value == "good" || input.value == "fine" || input.value == "tired") { input.setCustomValidity('"' + input.value + '" is not a feeling.'); } else { // input is fine -- reset the error message input.setCustomValidity(''); } } </script>
  • 52. Local Storage in Yahoo! Search Pad
  • 53. Local Storage in Yahoo! Search Pad http://www.jstorage.info/
  • 54. Application Storage / Offline <html manifest=”cache.manifest”> detect online or offline window.addEventListener('online', online, true); window.addEventListener('offline', online, true);
  • 55. Draggable <div draggable=”true”></div> addEvent(div, “dragstart”, function(e){ e.dataTransfer.setData(‘foo’, ‘bar’); }, true); addEvent(div, ‘dragend’, function(e){ e.dataTransfer.getData(‘foo’); }, true);
  • 57. Editable Content Turn an element into an editable area. <script> document.getElementsByTagName('p')[0].contentEditable = true; </script>
  • 58. Web Sockets var ws = new WebSocket("ws://hostname:80/"); ws.onmessage = function (event) { event.data }; ws.onclose = function () {}; ws.onopen = function () {};
  • 59. Web Worker new Worker("worker.js"); - Don’t have access to DOM or page. - Have to communicate through postMessage API
  • 61. Web GL 3D O3D http://www.youtube.com/watch?v=uofWfXOzX-g
  • 62. Questions? Marc Grabanski: http://marcgrabanski.com User interface and web application development. Examples: http://mjgin.com/work.html Twitter: http://twitter.com/1Marc Email: m@marcgrabanski.com