<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML + CSS + JavaScript &#187; HTML</title>
	<atom:link href="http://htmlcssjavascript.com/category/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://htmlcssjavascript.com</link>
	<description>Not a Ninja, Pirate or Jedi.</description>
	<lastBuildDate>Wed, 11 Jan 2012 18:18:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>I&#8217;m Going to Be Talking About HTML5 at the Enterprise 2.0 Conference, June 23</title>
		<link>http://htmlcssjavascript.com/html/im-going-to-be-presenting-on-html5-at-the-enterprise-2-0-conference-june-23/</link>
		<comments>http://htmlcssjavascript.com/html/im-going-to-be-presenting-on-html5-at-the-enterprise-2-0-conference-june-23/#comments</comments>
		<pubDate>Thu, 05 May 2011 15:48:28 +0000</pubDate>
		<dc:creator>Rob Larsen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[presentations]]></category>

		<guid isPermaLink="false">http://htmlcssjavascript.com/?p=8019</guid>
		<description><![CDATA[Here&#8217;s the description of the panel I&#8217;m on: HTML5 and its Impact on Enterprise Architecture (Location: Room 1) Although not yet ratified as an official standard, HTML5 support is showing up across a variety of different browsers. And for very good reason: HTML5 includes support for an important range of functionality – much of which [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the description of <a href="http://www.e2conf.com/boston/conference/architecture.php">the panel I&#8217;m on</a>:</p>
<blockquote><p>
  HTML5 and its Impact on Enterprise Architecture (Location: Room 1)</p>
<p>Although not yet ratified as an official standard, HTML5 support is showing up across a variety of different browsers. And for very good reason: HTML5 includes support for an important range of functionality – much of which has a direct bearing on Enterprise 2.0 applications.</p>
<p>Join a panel of experts who will critically review the prospects for HTML5 across three areas:</p>
<p>    * Enterprise Architectures<br />
    * Social Computing Applications<br />
    * Mobile</p>
<p>HTML5 is not a panacea, but it should simplify application development and help enterprises support a much wider set of mobile platforms. Come find out how.<br />
Moderator &#8211; Jarrod Gingras, Analyst, Real Story Group<br />
Panelist &#8211; Jonas Jacobi, Co-Founder and CEO, Kaazing Corporation<br />
Panelist &#8211; Rob Larsen, Interface Architect, Isobar</p></blockquote>
<p>I&#8217;ll be focusing on the mobile angle. I&#8217;ll be doing a 20-25 minute presentation and then  will stick around to answer some questions. </p>
<p>It should be interesting as the audience for this is going to be far different than my regular open source and developer-centric audience. The really interesting part is that I&#8217;m going to be able to sell HTML5 to a crowd that might not be totally hip to the fun we&#8217;re already having. </p>
]]></content:encoded>
			<wfw:commentRss>http://htmlcssjavascript.com/html/im-going-to-be-presenting-on-html5-at-the-enterprise-2-0-conference-june-23/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A New Site I Worked on is Live: Tauck.com</title>
		<link>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-tauck-com/</link>
		<comments>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-tauck-com/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 19:06:28 +0000</pubDate>
		<dc:creator>Rob Larsen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[my-work]]></category>

		<guid isPermaLink="false">http://htmlcssjavascript.com/?p=7976</guid>
		<description><![CDATA[Check it out: Tours and guided world travel adventures available at Tauck.com. Here&#8217;s a press release: Tauck and Isobar Bring Sights, Sounds and Social Side of Travel to Life Online NORWALK, CT, and BOSTON, MA, March 22, 2011 — The world’s leading guided travel operator, Tauck, and global creative agency Isobar announced today the launch [...]]]></description>
			<content:encoded><![CDATA[<p>Check it out:</p>
<p><a href='http://www.tauck.com/'>Tours and guided world travel adventures available at Tauck.com</a>.</p>
<p>Here&#8217;s a press release:<br />
<span id="more-7976"></span></p>
<blockquote><h3>Tauck and Isobar Bring Sights, Sounds and Social Side of<br />
Travel to Life Online</h3>
<p><strong>NORWALK, CT, and BOSTON, MA, March 22, 2011</strong> — The world’s leading guided travel operator, Tauck, and global creative agency Isobar <http://na.isobar.com/> announced today the launch of the new Tauck online experience: www.tauck.com.  The new site combines artistry and digital technology to immerse travel consumers in the “Tauck difference,” enabling Tauck consumers to connect, explore and share their experiences online and extend their journey before and after the trip like never before.  </p>
<p>Travel is a very personal and exciting experience. Consumers spend months and weeks planning and anticipating their travel adventures, and are eager to share and recount their memories with friends, family and other trip members long after they return home.  For the first time, Tauck travelers can share their excitement and experiences pre- and post-trip through a rich interactive journey that captures exquisite photography, elegant and descriptive content, breathtaking video, full-bodied itineraries, and social media.  In addition, the site is designed to capture the essence of the Tauck brand and help new visitors understand the wide range of premium travel experiences the company offers. </p>
<p>“For 86 years, Tauck has embodied exceptional quality, value and attention to every last detail,” said Dan Mahar, CEO of Tauck. “Isobar worked closely with our in-house team to bring those qualities to life online in a very real, full-on-sensory way.  If one of our journeys could be turned into a website, this is what it would look like.”</p>
<p>Among the site’s features are flexible, easy-to-use search tools that let travelers search for the perfect trip by location, interests and dates. Travel forums bring like-minded travelers together to not only share ideas, experiences, and advice, but connect before and after the trip to share photos and memories that enable lasting relationships.   </p>
<p>“Just as with every Tauck land journey or cruise, the site is designed to make travelers feel engaged, inspired and exceptionally well cared for,” said Michael Nicholas, Chief Strategy Officer at Isobar. “Combining both a beautiful, elegant front-end user experience with some powerful back-end digital and social technologies, the online experience has the ability to satisfy and delight the visitor on many different levels.”</p>
<p><strong>About Tauck</strong><br />
Tauck is the world&#8217;s leading guided travel operator. The company has been named the “World’s Best Tour Operator &#038; Safari Outfitter” three times by the readers of Travel &#038; Leisure magazine, and it enjoys the travel industry&#8217;s highest return-guest rate. Headquartered in Norwalk, Connecticut, the company offers nearly 100 expertly-choreographed itineraries in 65 countries and on all seven continents, including Tauck World Discovery land journeys, river and small-ship ocean cruises, Tauck Bridges family travel adventures, and active, immersive Culturious journeys designed for boomer-aged travelers.  Every Tauck travel experience is authentic, life-enriching and inspirational, and each is complemented by exceptional value and dedicated do-it-for-you service that have formed the cornerstone of the company since its launch in 1925.</p>
<p><strong>About Isobar</strong><br />
Isobar is a global creative agency that brings people and brands together like never before. We fuse creative thinking with technology know-how to uncover the best ideas and execute them across any platform or channel anywhere in the world.  Our unique combination of creatives and creators ensures the best ideas never end up on the cutting room floor, empowering us to consistently deliver innovative and intensely relevant brand experiences for the world’s largest brands. With locations in Boston, New York and San Francisco, Isobar US is an Aegis Media Group Company and part of the global Isobar network of over 50 offices in 30 markets.  For more information, please visit http://na.isobar.com.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-tauck-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A New Site I Worked On is Live (officially)</title>
		<link>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-officially/</link>
		<comments>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-officially/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 02:25:28 +0000</pubDate>
		<dc:creator>Rob Larsen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[my-work]]></category>
		<category><![CDATA[web-fonts]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://htmlcssjavascript.com/?p=7811</guid>
		<description><![CDATA[We finally launched the new Isobar North America site. It had been in a soft-launch phase for several weeks as we worked out the kinks. Now it&#8217;s official. I worked on it and, amazingly enough for an internal project I&#8217;m happy with it. I&#8217;ve actually had a good string with that, actually, having worked on [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://na.isobar.com/"><img src="http://htmlcssjavascript.com/wp-content/uploads/2010/11/isobar.jpg" alt="" title="isobar" width="600" height="459" class="alignnone size-full wp-image-7812" /></a></p>
<p>We finally launched the new <a href="http://na.isobar.com/">Isobar North America</a> site. It had been in a soft-launch phase for several weeks as we worked out the kinks. Now it&#8217;s official.</p>
<p>I worked on it and, amazingly enough for an internal project I&#8217;m happy with it.<br />
<span id="more-7811"></span><br />
I&#8217;ve actually had a good string with that, actually, having worked on two <a href="http://www.awidernet.com/">really fun</a> internal projects at <a href="http://www.crameronline.com/">Cramer</a>. It still seems like a miracle when it works out.</p>
<p>Anyway, it&#8217;s an HTML5 + CSS3 + WordPress monster of technical awesome. <a href="http://amodernfable.com/">Adam</a> and I had a lot of fun on the project, figuring out how to smash WordPress into shape. Good times.</p>
<p>High fives for all involved.</p>
<p>(And while you&#8217;re here, <a href="http://na.isobar.com/2010/living-social-isobar-your-invitation-to-participate/">why don&#8217;t you read Heather&#8217;s post that properly launches the thing</a>?) </p>
]]></content:encoded>
			<wfw:commentRss>http://htmlcssjavascript.com/html/a-new-site-i-worked-on-is-live-officially/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML5: What You Should Be Using Right Now</title>
		<link>http://htmlcssjavascript.com/html/html5-what-you-should-be-using-right-now/</link>
		<comments>http://htmlcssjavascript.com/html/html5-what-you-should-be-using-right-now/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 16:01:44 +0000</pubDate>
		<dc:creator>Rob Larsen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[methodology]]></category>
		<category><![CDATA[modernizr]]></category>
		<category><![CDATA[standards]]></category>

		<guid isPermaLink="false">http://htmlcssjavascript.com/?p=1029</guid>
		<description><![CDATA[Continuing our examination of HTML5, this time we&#8217;ll take a slightly deeper look at the state of HTML5 support in browsers. We&#8217;ll step through several major features, examine the technical hurdles in place, identify the level of browser support and finally provide some recommendations on whether or not to pull the trigger with that shiny [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing our examination of HTML5, this time we&#8217;ll take a slightly deeper look at the state of HTML5 support in browsers.  We&#8217;ll step through several major features, examine the technical hurdles in place, identify the level of browser support and finally provide some recommendations on whether or not to pull the trigger with that shiny new feature.</p>
<h2>New Semantic Elements</h2>
<p>HTML5 has added many new semantic elements. These both codify existing, common patterns and offer new, meaningful ways mark up your content. So, for example, going forward, instead of using <code>&lt;div id="header"&gt;</code> we will now just use <code>&lt;header&gt;</code>. Some other examples (with definitions culled from <a href="http://www.w3.org/TR/html5/">the specification</a>) include:</p>
<dl>
<dt>section</dt>
<dd>The section  element represents  a generic document or application section. A section, in this context, is a thematic grouping of content, typically with a heading.</p>
<p>Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site&#8217;s home page could be split into sections for an introduction, news items, contact information.</dd>
<dt>footer</dt>
<dd>The footer  element represents  a footer for its nearest ancestor sectioning content or sectioning root element. A footer typically contains information about its section such as who wrote it, links to related documents, copyright data, and the like.</dd>
<dt>nav</dt>
<dd>The nav  element represents  a section of a page that links to other pages or to parts within the page: a section with navigation links.</dd>
<dt>article</dt>
<dd>The article  element represents  a component of a page that consists of a self-contained composition in a document, page, application, or site and that is intended to be independently distributable or reusable, e.g. in syndication. This could be a forum post, a magazine or newspaper article, a blog entry, a user-submitted comment, an interactive widget or gadget, or any other independent item of content.</dd>
</dl>
<p>That&#8217;s far from a complete list, but it should serve to give you the flavor of what&#8217;s available.</p>
<h3>Support</h3>
<p>This is a curious case. If, by &#8220;support&#8221; we mean &#8220;doesn&#8217;t break anything&#8221; then the support here is broad. Using the <a href="http://code.google.com/p/html5shiv/">HTML5 Shiv</a> code snippet or the full blown <a href="http://www.modernizr.com/">Modernizr</a> library every browser that matters supports the HTML5 elements. If you&#8217;re expecting user agents to <strong>do</strong> something interesting with your new elements, then the support level is much lower.<br />
<span id="more-1029"></span></p>
<h3>The Verdict</h3>
<p><strong>Do it.</strong> This very site is built using the new semantic elements and it&#8217;s the fourth such site I&#8217;ve built in the past year. I&#8217;m happy to report- <em>I&#8217;m still standing.</em> While there&#8217;s a <em>slightly</em> higher degree of difficulty and there&#8217;s less certainty around HTML5 best practices than exists for earlier flavors of HTML; the hands-on experience with the new elements is enough reason to start using them as soon as possible. All the tutorials in the world can&#8217;t stand up to using the new elements against <em>your site</em> and solving your own problems with them.</p>
<h3>How-to</h3>
<p>Pretty easy, really. To allow the styling of the new elements in Internet Explorer (other browsers automatically allow unknown elements to be styled), either include the HTML5 Shiv</p>
<div class="code-sample wide"><code>
<pre>&lt;!DOCTYPE html&gt;
  &lt;html dir=&quot;ltr&quot; lang=&quot;en-US&quot; class=&quot;no-js&quot;&gt;
  &lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;
  &lt;meta charset=&quot;UTF-8&quot;&gt;
  &lt;!--[if IE]&gt;
  &lt;script type=&quot;text/javascript&quot;&gt;  var elem;  var elems = 'abbr article aside audio canvas datalist details eventsource figure footer header hgroup mark menu meter nav output progress section time video'.split(' ');  var i = elems.length+1;  while ( --i ) {  	elem = document.createElement( elems[i] );  }  elem = null;
  &lt;/script&gt;
  &lt;![endif]&gt;
  &lt;title&gt;HTML Shiv&lt;/title&gt;  </pre>
<p></code></div>
<p>or Modernizr:</p>
<div class="code-sample"><code>
<pre>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot; dir=&quot;ltr&quot; id=&quot;modernizr-com&quot; class=&quot;no-js&quot;&gt;
&lt;head&gt;
  	&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
  	&lt;title&gt;Modernizr&lt;/title&gt;
  	     &lt;script src=&quot;http://www.modernizr.com<a href="view-source:http://www.modernizr.com/downloadjs/">/downloadjs/</a>&quot;&gt;&lt;/script&gt;    </pre>
<p></code></div>
<p>and you&#8217;re ready to start in with the new HTML5 elements. what you do with those new elements is beyond the scope of this article, but there are plenty of <a href="http://html5doctor.com/">resources</a> <a href="http://www.ibm.com/developerworks/library/x-html5/">out there talking</a> <a href="http://htmlcssjavascript.com/html/how-to-make-a-web-site-the-modern-way-part-11-the-new-html5-elements/">about how to use</a> <a href="http://diveintohtml5.org/semantics.html">the new HTML5 elements</a>, to help you get started. </p>
<h2>Video</h2>
<p>This has become so pervasive a topic that for some people &#8220;HTML5&#8243; is shorthand for the new <code>&lt;video&gt;</code> element. With Apple blocking Adobe&#8217;s otherwise ubiquitous Flash player from iOS, much attention has been focused on the HTML5 alternative. This is good, because the more people talking about HTML5, the better chance we&#8217;ll have of all the browser manufacturers implementing the new features. </p>
<p>It&#8217;s also slightly problematic because of all the new HTML5 features the new video element might be the most messed up at the present time. </p>
<h3>Support</h3>
<p>Technically, &#8220;video&#8221; is supported by the latest versions of Chrome, Safari, Firefox and Opera, with support coming in Internet Explorer 9.</p>
<p>That&#8217;s the happy check-box view. </p>
<p>The <strong>reality</strong> is slightly more confusing (<em>and less happy</em>) as simply supporting the <code>video</code> element and related APIs is only half the story. What <a href="http://en.wikipedia.org/wiki/Codec">codecs</a>  and <a href="http://en.wikipedia.org/wiki/Container_format_%28digital%29">containers</a> each browser supports is as important as element/api support and unfortunately for all of us, battle lines have been drawn. Without getting into too much detail, there are basically two camps*- browsers that support open source solutions (currently Theora and <a href="http://www.webmproject.org/">VP8</a>)  and those that support h.264, a patent encumbered codec. In the open source camp we have Opera and Firefox. In the patent encumbered corner we have Apple and Microsoft&#8217;s Internet Explorer 9.  All of this means that there are no easy answers on how to move forward with the new video element, at least if the goal is to provide HTML5 video to the largest possible audience. </p>
<p>Things get a little easier if the only goal is to bring video to the iOS and other mobile devices. It&#8217;s still more complicated than the current Flash based solution, but it&#8217;s doable- at least with the right resources.</p>
<h3>The Verdict</h3>
<p>If you&#8217;re dying to get your video content onto the iPad and other mobile devices and you have the resources, then, <strong>yes</strong>.  Be warned, however, it brings with it added complexity, so factor that into your decision-making. </p>
<h3>How-to</h3>
<p>Unfortunately, because of the codec fragmentation the only worthwhile solution right now** is to ignore the open source solutions and encode your video as h.264 and package it in an MP4 container. That codec/container combination can be read by the video element in Safari and Chrome on the desktop as well as on Android phones and iOS. Most importantly, it can also be read by <strong>Flash</strong>. Which means, with a bit of smart coding on the HTML side, you can ensure that the widest possible range of devices will be able to consume your video. </p>
<p>What does that smart coding look like?</p>
<p>It looks like <a href="http://camendesign.com/code/video_for_everybody">Video for Everybody</a>.  </p>
<p>The basic pattern looks like this:</p>
<div class="code-sample wide"><code>
<pre>
&lt;!-- Start with HTML5 playback--&gt;
&lt;video width=&quot;640&quot; height=&quot;360&quot; controls preload=&quot;none&quot;&gt;
	&lt;source src=&quot;example.MP4&quot; type=&quot;video/mp4&quot; /&gt;&lt;!-- WebKit video    --&gt;
	&lt;!-- and then fallback to Flash: --&gt;
	&lt;object width=&quot;640&quot; height=&quot;384&quot; type=&quot;application/x-shockwave-flash&quot; data=&quot;video-player.SWF&quot;&gt;
		&lt;!-- FLASH STUFF --&gt;
		&lt;!--video-player.swf can play example.mp4 --&gt;
	&lt;/object&gt;
&lt;/video&gt;
</pre>
<p></code></div>
<p>This is a reasonable solution because you only have to encode and store one mp4 version of the video and it will cover pretty much any browser/OS combination that matters. </p>
<p>Additionally, outfits like <a href="http://www.brightcove.com/en/video-platform/solutions/html5">BrightCove</a> are working similar techniques into their platform work. Worth keeping in mind if you&#8217;re shopping for video solutions.</p>
<p>*Technically we have a third camp, as Google, with their Chrome browser, actually supports both.<br />
**Hopefully everyone will come together under the WebM banner, since it solves both the patent and quality arguments of the two warring camps, but that&#8217;s for the future to decide.  </p>
<h2>Geolocation</h2>
<p><a href="http://dev.w3.org/geo/api/spec-source.html">Geolocation</a>, a method of informing a website or web application of a user&#8217;s geographical location, isn&#8217;t &#8220;proper&#8221; HTML5, but it is of interest these days and is generally included as part of the informal specification, so I&#8217;m including it here.</p>
<h3>Support</h3>
<p>The new navigator.geolocation object is supported by Firefox 3.5+, Chrome 5.0+, Safari 5.0+, iPhone 3.0+ and Android 2.0+. Beyond that, using something like <a href="http://gears.google.com/">Google Gears</a>, or even just the user&#8217;s IP address, it&#8217;s possible to get <em>some</em> location data using other sources.  Here&#8217;s a quick demo using the <a href="http://isithackday.com/hacks/geo/yql-geo-library/">YQL Geo Library</a>. It should do <em>something</em> in pretty much any browser.</p>
<p><iframe width="100%" height="200" src="/samples/iso/html5/geolocation/" style="border:1px solid #999"></iframe></p>
<h3>The Verdict</h3>
<p>If you don&#8217;t need absolute precision for all users or then by all means, work some secondary geolocation features into your site or web application. You can do a reasonable job in a wide range of browsers. If you&#8217;re trying to get high quality location data then your options are a little more limited in the browser. </p>
<h3>How-to</h3>
<p>Using a library like <a href="http://code.google.com/p/geo-location-javascript/">geo.js</a> or the previously mentioned <a href="http://isithackday.com/hacks/geo/yql-geo-library/">YQL Geo Library</a> smooths out the rough patches between the geolocation api itself and the various fallback methods.  For a quick illustration of how easy it is to get basic data, here&#8217;s the entire script used in the above demo:</p>
<div class="code-sample wide"><code>
<pre>
document.getElementById("geolocate").onclick= function() {
      yqlgeo.get('visitor',function(o){
			var result = document.getElementById("result");
			result.innerHTML += " " + o.place.name + "," + o.place.country.content +  " (" + o.place.centroid.latitude + "," + o.place.centroid.longitude + ")";
			result.style.display="block";
		}
	)
}</pre>
<p> </code></div>
<p>Not much to it, but using that you&#8217;ve got a friendly place name (which is provided by a <a href="http://developer.yahoo.com/yql/">yql</a> service, not the geolocation api itself) and lat/long (the heart of the actual geolocation api). From there you&#8217;ve ready to spin a web of location-based wonder and amazement. </p>
<p>Looking to the future, using the actual underlying geolocation api isn&#8217;t much more verbose with the navigator.geolocation.getCurrentPosition providing a straightforward interface to the browser&#8217;s location data.</p>
<h2>Web Storage</h2>
<p>Web Storage is a method of storing data, in the form of name/value pairs, locally on a user&#8217;s machine. File this one under: not flashy, but super useful.</p>
<h3>Support</h3>
<p>Stunningly, the latest version of every major browser supports localStorage. You get 5MB of persistent storage across the board. For IE7 and IE6, if you really had to figure out a local storage solution, you could potentially leverage <a href="http://msdn.microsoft.com/en-us/library/ms531424%28VS.85%29.aspx">userData</a> or <a href="http://gears.google.com/">Gears</a>, both of which offer similar functionality.</p>
<h3>The Verdict</h3>
<p>With such broad support, it makes sense to start enhancing pages with localStorage. Saving trips to the server is always good, so storing more (<strong>non-sensitive</strong>*) data on the client side is going to be a positive for your users.</p>
<h3>How-to</h3>
<p>At the most basic level, there are three things you need to know about, setting items, getting items and the storage event.</p>
<div class="code-sample wide"><code>
<pre>
//use modernizr to test for support
if (Modernizr.localstorage) {
    // window.localStorage is a go!
    function setGet(){
        //set some data. It's stored as a String, btw.
        localStorage.setItem(&quot;dharma.station.swan.status&quot;, &quot;destroyed&quot;,);
        //get some data
        var swanStatus = localStorage.getItem(&quot;dharma.station.swan.status&quot;);
    }
    //we can also listen for storage events
    function omgStorage(){
        alert("someone stored something. Just though you should know.");
    }
window.addEventListener(&quot;storage&quot;, omgStorage, false);
} </pre>
<p></code></div>
<h4>PersistJS</h4>
<p><a href="http://pablotron.org/software/persist-js/">PersistJS</a> is an excellent, cross-browser interface to the fll spectrum of localStorage and related solutions. Providing a single interface to the W3C version, Internet Explorer&#8217;s, Gear&#8217;s and even Flash&#8217;s implementation, Persist is a solid solution for the current fragmented local storage landscape.</p>
<p>Here&#8217;s what a simple example of Persist looks like in action:</p>
<div class="code-sample wide"><code>
<pre>
var store = new Persist.Store(&quot;MyData&quot;);store.set(&quot;MyName&quot;, &quot;Rob Larsen&quot;)
store.get(&quot;MyData&quot;, function(ok,data){
	if(ok){
	    	console.log(data);
	   }
   })</pre>
<p></code></div>
<p>*<a href="http://www.nczonline.net/blog/2010/04/13/towards-more-secure-client-side-data-storage/">data is saved unencrypted on disk</a></p>
<h2>Canvas</h2>
<p>To quote the spec, Canvas is &#8220;a resolution-dependent bitmap canvas which can be used for rendering graphs, game graphics, or other visual images on the fly.&#8221; It&#8217;s one of the most exciting of the new HTML5 features because it promises the ability to do really advanced graphics, games and visualizations right in the browser- without the aid of a plugin. Staying within the web standards stack we can now start to do some of the things we relied on Flash for up until now.</p>
<h3>Support</h3>
<p>The latest version of every browser but Internet Explorer supports Canvas natively. Thankfully, support for IE can be provided by the <a href="http://code.google.com/p/explorercanvas/">Explorercanvas</a> library, a clever bit of coding that transforms Canvas methods into VML. The downside to that is, of course, speed. Performance for more complicated Canvas scripting is very slow on IE. This is especially true for animations and interactive elements. In addition there are several canvas features that simply don&#8217;t translate. Still, it&#8217;s a viable solution.</p>
<h3>The Verdict</h3>
<p>If you&#8217;re willing to sacrifice a little bit of speed in IE and aren&#8217;t pushing the boundaries of what Canvas is capable of, it&#8217;s pretty safe to start using Canvas right now. Explorercanvas works pretty well, and in browsers that support it natively, the experience can be great. </p>
<p>There are also <a href="http://www.paciellogroup.com/blog/?p=362">concerns about accessibility</a>, which is definitely something to keep in mind. </p>
<h3>How-to</h3>
<p>A proper how-to for the canvas element is beyond the scope of this article. In place of that here&#8217;s an extremely simple demo and some code that will hopefully illustrate basic concepts. </p>
<p>Here&#8217;s the demo. It converts a data table into a bar chart using some canvas methods.  </p>
<p><iframe src="/samples/iso/html5/canvas/" width="525" height="325" style=" style="border:1px solid #999"></iframe></p>
<p><em>Wow, that was fun.</em> </p>
<p>Let&#8217;s look at the code.</p>
<p>The HTML is nothing special. The Canvas element just sits there until JavaScript brings it to life.</p>
<div class="code-sample wide"><code>
<pre>
&lt;table id=&quot;data-table&quot;&gt;
    &lt;tr&gt;
        &lt;td&gt;15&lt;/td&gt;
        &lt;td&gt;25&lt;/td&gt;
        &lt;td&gt;10&lt;/td&gt;
        &lt;td&gt;25&lt;/td&gt;
        &lt;td&gt;50&lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;
&lt;button id=&quot;canvas-controller&quot;&gt;Chart It!&lt;/button&gt;
&lt;canvas id=&quot;canvas-sample&quot; width=&quot;350&quot; height=&quot;200&quot;&gt;
&lt;/canvas&gt;
</pre>
<p></code></div>
<p>Here&#8217;s the JavaScript. Comments inline.</p>
<div class="code-sample wide"><code>
<pre>
document.getElementById(&quot;canvas-controller&quot;).addEventListener(&quot;click&quot;, writeCanvas, false);

function writeCanvas(e){
//we need a reference to the canvas. Typical DOM stuff
    var canvas = document.getElementById(&quot;canvas-sample&quot;);
//Then we get the "context." It's the reference
//to the drawing surface itself.
var context = canvas.getContext(&quot;2d&quot;); 
//get the data cells
    var tds = document.getElementById(&quot;data-table&quot;).getElementsByTagName(&quot;td&quot;);
//set up a list of colors
    var colors = [&quot;#3366FF&quot;,
        &quot;#6633FF&quot;,
        &quot;#003DF5&quot;,
        &quot;#002EB8&quot;,
        &quot;#66FF33&quot;
    ];
//Let's draw some grid lines
    for (var y = 0; y &lt; canvas.offsetHeight; y += 10) {
//moveTo and lineTo are pretty clearly named functions.
//move the "point" to a new place
	    context.moveTo(0, y);
//and plot a line
    	context.lineTo(canvas.offsetWidth, y);
    }
//what's not clear is that running the above commands doesn't
//actually draw anything. These next two commands do.
//set a style for line "stroke"
    context.strokeStyle = &quot;#ccc&quot;;
//and then call the function that makes the lines happen
    context.stroke();
//set a bunch of variables
    var basewidth, spacing, width, height, posx, posy;
//loop through
var i = tds.length;
	while (i--) {
//calculate a uniform "base" width for the bars
   	basewidth = canvas.offsetWidth/tds.length;
//set up some spacing
    	spacing = basewidth/4;
//calculate the actual width of the bars
    	width = basewidth - spacing;
//set up a height. This isn't actually to any scale.
//It just looked good <img src='http://htmlcssjavascript.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
    	height = parseInt(tds[i].innerHTML)*3;
//calculate the x position with some spacing between the bars
    	posx = (i * basewidth) + spacing/2;
//pin the bars to the bottom of the canvas
    	posy= canvas.offsetHeight-height;
//set the color
    	context.fillStyle = colors[i];
//and then fill it.
//The fillRect takes (x,y,width,height) as arguments
    	context.fillRect(posx, posy, width , height );
    }
//stop the clicks.
    e.preventDefault();
}
</pre>
<p></code></div>
<hr />
<p>And that&#8217;s that. </p>
<p>Hopefully you&#8217;ve come away with a better understanding of the current support levels for HTML5. All in all, it&#8217;s really not that bad. The landscape is manageable for many of the newest technologies and if we can light a fire under Microsoft to release IE9 it&#8217;ll only get better. </p>
<p>So basically, pick your spots, understand the risks,  and dive right in. </p>
<hr />
<p><cite><a href="http://na.isobar.com/2010/html5-what-you-should-be-using-right-now/">This post originally appeared on the Isobar North America blog</a></cite></p>
]]></content:encoded>
			<wfw:commentRss>http://htmlcssjavascript.com/html/html5-what-you-should-be-using-right-now/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To Make a Web Site the Modern Way. Part 11: The New HTML5 Elements</title>
		<link>http://htmlcssjavascript.com/html/how-to-make-a-web-site-the-modern-way-part-11-the-new-html5-elements/</link>
		<comments>http://htmlcssjavascript.com/html/how-to-make-a-web-site-the-modern-way-part-11-the-new-html5-elements/#comments</comments>
		<pubDate>Mon, 10 May 2010 15:43:00 +0000</pubDate>
		<dc:creator>Rob Larsen</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[how-to-make-a-web-site]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://htmlcssjavascript.com/?p=860</guid>
		<description><![CDATA[I promised one last post on HTML elements. This is it. This one will be a quick tour through some of the new semantic HTML5 elements. I&#8217;ve been using them regularly for a while now and I&#8217;m still trying to wrap my head around the best way to use some of them (in this, I&#8217;m [...]]]></description>
			<content:encoded><![CDATA[<p>I promised one last post on HTML elements. This is it. This one will be a quick tour through some of the new semantic HTML5 elements. I&#8217;ve been using them regularly for a while now and I&#8217;m still trying to wrap my head around the best way to use some of them (in this, I&#8217;m not alone.) Hopefully sharing what I&#8217;ve learned will help jump start your own work with the new stuff and will help my clarify my own thoughts on the new elements.</p>
<p>This should really be fun.</p>
<h2>header</h2>
<p>This is one of the most straightforward of the new elements. &lt;div id=&quot;header&quot;&gt; becomes &lt;header&gt;. Done. When I&#8217;ve presented on HTML5 people just nod when I point this element out. Hopefully this one just makes sense. </p>
<h3>One experimental note</h3>
<p>One thing we&#8217;ve been experimenting with at work is using multiple <code>headers</code> on a page. The pattern looks like this:<br />
<span id="more-860"></span></p>
<div class="code-sample"><code>
<pre>
&lt;!DOCTYPE html&gt;&lt;html lang=&quot;en&quot;&gt;&lt;body&gt;
&lt;header&gt;
  &lt;h1&gt;site logo&lt;/h1&gt;&lt;/header&gt;
&lt;section id=&quot;posts&quot;&gt;
    &lt;header&gt;
      &lt;h1&gt;This is our section header&lt;/h1&gt;
    &lt;/header&gt;
  &lt;article&gt;
    &lt;header&gt;
      &lt;h1&gt;This is our article header&lt;/h1&gt;
    &lt;/header&gt;
  	 &lt;p&gt;this is our article&lt;/p&gt;
    &lt;footer&gt;
      &lt;p&gt;this is the post footer&lt;/p&gt;
    &lt;/footer&gt;
   &lt;/article&gt;
&lt;section&gt;
&lt;footer&gt;  &lt;p&gt;site footer&lt;/p&gt;&lt;/footer&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p></code></div>
<p>The idea being- this is truly a copy and paste waiting to happen.  The <code>article</code> is truly standalone.  I&#8217;m not quite sure if I like it or not yet, but it&#8217;s a perfect example of why I&#8217;ve started using HTML5 wherever possible. There&#8217;s a lot to take in, so I figure the best way to wrap your head around it all is to roll up your sleeves and write some code.</p>
<h2>footer</h2>
<p>If <code>header</code> makes sense, <code>footer</code> should as well. There are a lot of &lt;div id=&quot;footer&quot;&gt;s out there.</p>
<h2>nav</h2>
<p><code>nav</code> is for navigation elements. Looking at my markup for the <a href="http://www.drunkenfist.com/304/">blog@drunkenfist.com</a>, you&#8217;ll see where I like to use <code>nav</code> and where I&#8217;ll stick to an unadorned UL.</p>
<p><a href="http://www.drunkenfist.com/304/"><img src="http://htmlcssjavascript.com/wp-content/uploads/2010/05/nav-vs-ul.jpg" alt="" title="nav-vs-ul" width="493" height="658" class="alignnone size-full wp-image-874" /></a></p>
<p>I use it for the main site navigation (the clearest use), for the post-navigation (back and next, another clear use) and for the social media/contact links (the weakest use.) The first two are perfect, I think. The third use is a weaker case to me and looking at it today, I&#8217;m tempted to remove it from that section. The idea there was that it&#8217;s meta navigation, dealing with the breadth of my internet presence, not just the site.  <em>Chewing on that one&#8230;</em></p>
<p>I <strong>don&#8217;t</strong> use it for the WordPress archive and links lists. I don&#8217;t really feel like those are navigation. They&#8217;re more informational. So, no <code>nav</code>.   </p>
<h2>section</h2>
<p>Section is defined like this:</p>
<blockquote><p>The section  element represents  a generic section of a document or application. A section, in this context, is a thematic grouping of content, typically with a heading.</p>
<p>Examples of sections would be chapters, the various tabbed pages in a tabbed dialog box, or the numbered sections of a thesis. A Web site&#8217;s home page could be split into sections for an introduction, news items, contact information.</p>
<p>Authors are encouraged to use the article element instead of the section element when it would make sense to syndicate the contents of the element.</p>
<p>The section element is not a generic container element. When an element is needed for styling purposes or as a convenience for scripting, authors are encouraged to use the div element instead. A general rule is that the section element is appropriate only if the element&#8217;s contents would be listed explicitly in the document&#8217;s outline.</p></blockquote>
<p>So the general rule of thumb I use is to try to define the section, in terms of the content contained therein, before actually using one. That separates out a lot of structural uses. To look at DrunkenFist.com again, I use sections on my home page for events, site updates and my little collection of blog updates:</p>
<p><img src="http://htmlcssjavascript.com/wp-content/uploads/2010/05/sections.png" alt="" title="sections" width="400" height="474" class="alignnone size-full wp-image-878" /></p>
<p><a href="http://gsnedders.html5.org/outliner/process.py?url=http%3A%2F%2Fwww.drunkenfist.com%2F">The outline is pretty good</a>:</p>
<ol>
<li>Rob Larsen
<ol>
<li>Home
<ol>
<li>Art Portfolio
<ol>
<li>Graffiti Art</li>
<li>Comic Book Art</li>
<li>Color Art</li>
<li>Black and White Art</li>
<li>Pencil Drawings</li>
</ol>
</li>
<li>Movies
<ol>
<li>Hong Kong Cinema Articles, Reviews and Interviews</li>
<li>Hollywood Film Reviews and Interviews</li>
<li>Japanese Cinema Reviews</li>
<li>Independent and Foreign Film Reviews</li>
<li>An Index of Every Film Reviewed on The Site</li>
</ol>
</li>
<li>No Mod Required, Rob&#8217;s blog</li>
<li>More about Rob Larsen and DrunkenFist.com</li>
</ol>
</li>
<li>Upcoming Speaking Engagements</li>
<li>Current Art Shows</li>
<li>New at the Site</li>
<li>Blog Headlines
<ol>
<li>No Mod Required</li>
<li>HTML + CSS + JavaScript</li>
<li>It&#8217;s All Just Comics </li>
</ol>
</li>
<li><i>Untitled Section</i>
<ol>
<li>Links:</li>
</ol>
</li>
<li><i>Untitled Section</i></li>
</ol>
</li>
</ol>
<p>More on the untitled sections later.</p>
<h2>article</h2>
<p>If it&#8217;s <strong>content</strong> and I can imagine someone copying and pasting the entire &lt;article&gt;&#8230;&lt;/article&gt; then it&#8217;s an <code>article</code>. </p>
<p>One thing I <strong>haven&#8217;t</strong>  tried is this, suggested in the spec:</p>
<blockquote><p>When article  elements are nested, the inner article  elements represent articles that are in principle related to the contents of the outer article. For instance, a blog entry on a site that accepts user-submitted comments could represent the comments as article  elements nested within the article  element for the blog entry.
</p></blockquote>
<p>One of the ongoing debates is how to mark up blog comments. This is an interesting approach to that particular issue. Maybe on my current project?</p>
<p>Yes.</p>
<p>If you want an in-depth view of the differences between <code>article</code> and <code>section</code>, then check out <a href="http://www.brucelawson.co.uk/2010/html5-articles-and-sections-whats-the-difference/">Bruce Lawson&#8217;s article on the subject.</a></p>
<h2>time</h2>
<p><code>time</code> represents, well, time. One thing to note is when using it within an <code>article</code> you should set the pubdate flag to indicate that it&#8217;s a publication date.</p>
<p>Here&#8217;s what that looks like:</p>
<div class="code-sample"><code>
<pre>
&lt;h1&gt;How To Make a Web Site the Modern Way. Part 11: The New HTML5 Elements&lt;/h1&gt;
    &lt;p class=&quot;date&quot;&gt;
      &lt;time datetime=&quot;2010-05-08T09:18:49-04:00&quot; pubdate&gt;May 8th, 2010&lt;/time&gt;
      by Rob Larsen
    &lt;/p&gt;  </pre>
<p></code></div>
<h2>aside</h2>
<p><code>aside</code> is a tricky one. Is it a sidebar? The more I think about it, the less I think it is. One reason is visible above. The first of the &#8220;Untitled sections&#8221; in the outline is an <code>aside</code>. So that mixed with a closer reading of the spec have lead me away from using asides for most generic sidebars. Depending on the content, some of them still might be asides, some might be sections, some might be navs and plenty will be generic divs. </p>
<p>One place I am comfortable with asides is visible in the context of <a href="http://www.drunkenfist.com/movies/hong-kong/crouching-tiger-hidden-dragon.php">a movie review on Drunkenfist.com</a>.</p>
<p><img src="http://htmlcssjavascript.com/wp-content/uploads/2010/05/aside.png" alt="" title="aside" width="350" height="506" class="alignnone size-full wp-image-887" /></p>
<p>To me, that seems like a good use case as defined in the spec:</p>
<blockquote><p>[an aside is] a section of a page that consists of content that is tangentially related to the content around the aside  element, and which could be considered separate from that content.&#8221;
</p></blockquote>
<h2>figure</h2>
<p>A <code>figure</code>, combined with a <code>figcaption</code> is meant to mark up a note, be it text or visual, illustrating a portion of an article. The figure is the added content and the figcaption is a semantically linked text accompanying caption. The figure can contain text, image(s) or video(s).</p>
<hr />
<p>And that&#8217;s that.</p>
<p>The above is clearly not a comprehensive introduction to HTML5. There are a <strong>lot</strong> of pieces of the specification that it ignores. Still it should give you a good sense of the new semantic elements and how they&#8217;re used. I can&#8217;t stress how easy and how useful it is to start using these elements right now.  There&#8217;s a lot to learn about and starting as soon as possible is the way to go.</p>
<hr/>
<p>And with that, we end our tour of HTML elements.  It&#8217;s taken a while, but I think it&#8217;s been worth it. </p>
<hr/>
<p>Now, time for CSS</p>
<p><!--showposts tag="how-to-make-a-web-site" num="-1" orderby="date" order="ASC"--></p>
]]></content:encoded>
			<wfw:commentRss>http://htmlcssjavascript.com/html/how-to-make-a-web-site-the-modern-way-part-11-the-new-html5-elements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

