HTML5 - The 2012 of the Web

Preview:

DESCRIPTION

 

Citation preview

HTML5 -

The 2012 of the Web

Mozilla is a global non-profit dedicated to putting you in control of your online experience and shaping the future of the Web for the public good

2012

Mesoamerican Long Count calendar

"The beginning of a new era"

HTML4 * 1000

HTML 4000

What is HTML5?

HTML5 semantics

<!DOCTYPE html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<meta charset="utf-8">

<input type="color">

<input type="date">

<input type="datetime">

<input type="datetime-local">

<input type="email">

<input type="month">

<input type="number">

<input type="range">

<input type="search" results="5" autosave="saved-searches">

<input type="tel">

<input type="time">

<input type="url">

<input type="week">

New form types

<input type="text" autocomplete="off">

<input type="text" autofocus>

<input type="submit" formaction="http://example.org/save" value="Save">

<input type="submit" formenctype="application/x-www-form-urlencoded" value="Save with enctype">

<input type="submit" formmethod="POST" value="Send as POST">

<input type="submit" formnovalidate value="Don't validate">

<input type="submit" formtarget="_blank" value="Post to new tab/window">

New form attributes

<input type="text" list="data-list">

<input type="range" max="95">

<input type="range" min="2">

<input type="file" multiple>

<input type="text" readonly>

<input type="text" required>

<input type="text" pattern="[A-Z]*">

<input type="text" placeholder="E.g. Robocop">

<input type="text" spellcheck="true">

<input type="number" step="5">

<input type="text" list="data-list">

<datalist id="data-list"> <option value="Hugo Reyes"> <option value="Jack Shephard"> <option value="James 'Sawyer' Ford"> <option value="John Locke"> <option value="Sayid Jarrah"></datalist>

New form elements

<keygen></keygen>

<meter min="0" max="10" value="7"></meter>

<input type="range" id="range"><output for="range" id="output"></output>

<progress max="100" value="70">70%</progress>

<input type="range" id="range"><output for="range" id="output"></output>

<script> (function () { var theForm = document.getElementById("the-form"); if ("oninput" in theForm) { theForm.addEventListener("input", function () { output.value = range.value; }, false); } })();</script>

sessionStorage.setItem("Charming", "Anthony Weiner");console.log(sessionStorage.getItem("Charming"));

localStorage.setItem("Occupation", "Politician");

var anthonyWeiner = { "Interest" : "Photography", "Social" : "Twitter"};

localStorage.setItem("anthonyWeiner", JSON.stringify(anthonyWeiner));

console.log(typeof JSON.parse(localStorage.getItem("anthonyWeiner")));

IndexedDBWeb SQL

window.history.pushState(state, title, url);

var url = "http://robertnyman.com",title = "My blog",state = { address : url};

window.history.pushState(state, title, url);

What came before WebSockets?

Cross Frame Communication

HTTP Polling

LiveConnectForever Frame

AJAX

HTTP Long-Polling and XHR Streaming

var ws = new WebSocket("ws://robertnyman.com/wsmagic");

// Send dataws.send("Some data");

// Close the connectionws.close();

var ws = new WebSocket("ws://robertnyman.com/wsmagic");

// When connection is openedws.onopen = function () { console.log("Connection opened!");};

// When you receive a messagews.onmessage = function (evt) { console.log(evt.data);};

// When you close the connectionws.onclose = function () { console.log("Connection closed");};

// When an error occurred ws.onerror = function () { console.log("An error occurred");};

<video controls src="nasa.webm"></video>

<video controls> <source src="nasa.mp4"></source> <source src="nasa.webm"></source> <p>Hello, older web browser</p></video>

<video src="http://vid.ly/4w2g7d?content=video" controls></video>

<canvas id="my-canvas" width="500" height="500"> I am canvas</canvas>

var canvas = document.getElementById("my-canvas"), context = canvas.getContext("2d");

context.fillStyle = "#f00";context.fillRect(0, 0, 100, 100);

context.clearRect(40, 40, 20, 20);

Is it ready? Will HTML5 be around?

Why did I hug that bear?

Is it ready?

Is it ready?

http://canisue.com

HTML5 -

The beauty of the Open Web

Recommended