28. As XHTML
<?xml version="1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml">
MUST be application/xhtml+xml or application/xml
<noscript>Not in XHTML</noscript>
36. <article id="main" role="main">
<section id="main-content">
<header>
<hgroup>
<h2>A title</h2>
<h3>Subtitle to the above title</h3>
</hgroup>
</header>
<article>
<p>
Some content, created <time datetime="2010-01-31">January 31st 2010</time>.
</p>
</article>
<article>
<p>Some more content - I guess you get the drift by now.</p>
</article>
</section>
<aside role="complementary">
This is just a demo page to see HTML5 markup and WAI-ARIA landmark roles in action.
</aside>
</article>
44. <video controls>
<source src="swedish-flag.mp4">
<source src="swedish-flag.ogv">
<p>
Sorry, your web browser doesn't
support the video element.
</p>
</video>
73. var ws = new WebSocket("ws://robertnyman.com/wsmagic");
// Send data
ws.send("Some data");
// Close the connection
ws.close();
74. var ws = new WebSocket("ws://robertnyman.com/wsmagic");
// When connection is opened
ws.onopen = function () {
console.log("Connection opened!")
};
// When you receive a message
ws.onmessage = function (evt) {
console.log(evt.data);
};
// When you close the connection
ws.onclose = function () {
console.log("Connection closed");
};
// When an error occurred
ws.onerror = function () {
console.log("An error occurred")
};