<?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>PC Pro blog &#187; Ian Devlin</title>
	<atom:link href="http://www.pcpro.co.uk/blogs/author/ian-devlin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pcpro.co.uk/blogs</link>
	<description>Blogging in the real world</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:54:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Making HTML5 work in old versions of Internet Explorer</title>
		<link>http://www.pcpro.co.uk/blogs/2011/03/07/making-html5-work-in-old-versions-of-internet-explorer/</link>
		<comments>http://www.pcpro.co.uk/blogs/2011/03/07/making-html5-work-in-old-versions-of-internet-explorer/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 09:35:18 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[browser compatibility]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[legacy browsers]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=35299</guid>
		<description><![CDATA[
One of the main reasons why developers may not be making the move to HTML5 as yet is the perceived lack of support for legacy browsers. This is actually untrue, and whilst there might be some jiggery pokery required for proper backwards compatibility, it&#8217;s still possible.
Of course, by legacy browsers I mean Internet Explorer, as [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2011/03/legacy-and-html52.jpg" alt="HTML5 and Legacy Browsers" /></p>
<p>One of the main reasons why developers may not be making the move to HTML5 as yet is the perceived lack of support for legacy browsers. This is actually untrue, and whilst there might be some jiggery pokery required for proper backwards compatibility, it&#8217;s still possible.</p>
<p>Of course, by legacy browsers I mean Internet Explorer, as all the other major players update regularly and their users tend to follow suit: browsers such as Firefox, Safari and Opera have supported HTML5 for a while. Some developers may decide to stop supporting IE6, but for some that&#8217;s not an option and, at any rate, neither IE7 nor IE8 support HTML5 either. <a href="http://ie.microsoft.com/testdrive/" target="_new">IE9</a> will, but it runs on Windows Vista and Windows 7 only, so the other versions will still be around for a long time to come, as we have seen with IE6.</p>
<p>So what needs to be done to get HTML5 working in Internet Explorer?</p>
<p><span id="more-35299"></span></p>
<h2>Unknown elements</h2>
<p>Well first and foremost, IE won&#8217;t render any elements it doesn&#8217;t recognise, so it will completely ignore HTML5 structural elements such as <code>header</code>, <code>footer</code>, <code>article</code>, <code>section</code>, and <code>nav</code>, all major parts of a HTML5 site. This can be rectified by telling IE about these elements using JavaScript. The best way to do this is to include the <a href="http://code.google.com/p/html5shiv/" target="_new">HTML5 shiv</a> script, created by Remy Sharp. This handy script creates all the relevant HTML5 elements which IE will now know about when rendering the page.</p>
<p>One problem with this is that it won&#8217;t work for users who have JavaScript turned off. Unfortunately there is no way around this, so a decision has to be made by the developer to either use HTML5 or stay with HTML 4.01.</p>
<h2>Styling</h2>
<p>Most browsers have internal stylesheets that, amongst other things, apply <code>display:block</code> to block level elements. Whilst some of the newer browsers now do this for the relevant HTML5 elements, some don&#8217;t, and this needs to be added for all browsers. Simply adding the following styling will do the trick:</p>
<p><code>article, aside, figure, footer, header, hgroup,<br />
menu, nav, section { display:block; }</code></p>
<h2>Form elements</h2>
<p>And what about some of the new elements themselves, such as the <a href="http://www.456bereastreet.com/archive/201004/html5_input_types/" target="_new">new input types</a> - how do these render on legacy browsers?</p>
<p>Fine actually. Since the HTML5 spec was extended in a <a href="http://www.webstandards.org/2009/05/13/interview-with-ian-hickson-editor-of-the-html-5-specification/" target="_new">backwards-compatible way</a>, any input types that aren&#8217;t recognised, are simply treated as <code>text</code> and will simple be rendered as so.</p>
<h2>Multimedia</h2>
<p>As I&#8217;ve discussed in the past, the <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video</a> and <a href="http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/">audio</a> elements are designed to allow a fall back to Flash, which will work fine on Internet Explorer.</p>
<p>The move to HTML5 will still be a gradual one, and some won&#8217;t see nor have the need to use any of the new functionality that it provides, but when they do, they can be (relatively) safe in the knowledge that older browsers will render their sites just fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2011/03/07/making-html5-work-in-old-versions-of-internet-explorer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Why the HTML5 logo from the W3C only adds to the confusion</title>
		<link>http://www.pcpro.co.uk/blogs/2011/01/19/why-the-html5-logo-from-the-w3c-only-adds-to-the-confusion/</link>
		<comments>http://www.pcpro.co.uk/blogs/2011/01/19/why-the-html5-logo-from-the-w3c-only-adds-to-the-confusion/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 10:45:41 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[logo]]></category>
		<category><![CDATA[w3c]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=31660</guid>
		<description><![CDATA[
Yesterday the W3C decided to release a logo for HTML5. Nothing wrong with that you might say, and I would agree with you. They have created a badge builder which allows you to specify which specific parts of HTML5 your website uses and enable users to see at a glance (provided they&#8217;re familiar with the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2011/01/html5-logo.jpg" alt="HTML5 Logo" /></p>
<p>Yesterday the <a href="http://www.w3.org/" target="_new">W3C</a> decided to release a <a href="http://www.w3.org/html/logo/" target="_new">logo for HTML5</a>. Nothing wrong with that you might say, and I would agree with you. They have created a <a href="http://www.w3.org/html/logo/#badge-builder" target="_new">badge builder</a> which allows you to specify which specific parts of HTML5 your website uses and enable users to see at a glance (provided they&#8217;re familiar with the icons of course) what you have used when building your site.</p>
<p>Great. Splendid.</p>
<p>The W3C has always provided <a href="http://www.w3.org/QA/Tools/Icons" target="_new">icons</a> in the past to place on your website to indicate validation for the various versions of HTML, XHTML, CSS and others. And although this particular logo doesn&#8217;t indicate validity, it is in fact an improvement on it.</p>
<p>But. There&#8217;s a problem.</p>
<p><span id="more-31660"></span></p>
<blockquote><p>The logo is a general-purpose visual identity for a broad set of open web technologies, including HTML5, CSS, SVG, WOFF, and others</p></blockquote>
<p>Last year I wrote about <a href="http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/">the confusion surrounding HTML5</a> and one of the main points I attempted to drive home was that CSS3 was not part of HTML5. I&#8217;m not the only one to underline this, <a href="http://www.brucelawson.co.uk/2010/rant-html5-css-3/" target="_new">Bruce Lawson</a> says as much, there&#8217;s even a <a href="http://iscss3partofhtml5.com/" target="_new">website</a> dedicated to it!</p>
<p>But, as I was saying, there&#8217;s a problem with this new HTML5 logo from the W3C. If you go to the <a href="http://www.w3.org/html/logo/#badge-builder" target="_new">badge builder</a>, there&#8217;s a selection of tick boxes for you to show off what parts of HTML5 your site uses. And one of those options is CSS3/styling.</p>
<p>As I&#8217;ve said, CSS3 is not part of HTML5. But the W3C appears to be supporting the fact that it is, thus adding to the confusion and in my eyes bowing down to the marketing types who don&#8217;t understand such things. Developers do, and yet the W3C seems to be trying to convince the developers to also shove CSS3 under the HTML5 umbrella.</p>
<p>Sorry W3C, but this developer is not going down that route.</p>
<p>It gets even worse.</p>
<p>The <a href="http://www.w3.org/html/logo/faq.html" target="_new">FAQ</a> itself describes the logo as:</p>
<p><em>a general-purpose visual identity for a broad set of open web technologies, including HTML5, CSS, SVG, WOFF, and others.</em></p>
<p>which lumps almost everything and anything under the HTML5 name. I despair.</p>
<p>Don&#8217;t get me wrong, I will use the HTML5 logo, it&#8217;s nice, it can be vertical or horizontal, you can <a href="http://www.w3.org/html/logo/#downloads" target="_new">download the images</a> and make your own, with different colours etc, so it&#8217;s very flexible and aesthetically pleasing and will fit in with almost any design, should you choose to use it.</p>
<p>But sorry W3C. I&#8217;m putting my hands over my ears like a child and am simply not listening. CSS3 is not part of HTML5, and neither are SVG and WOFF for that matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2011/01/19/why-the-html5-logo-from-the-w3c-only-adds-to-the-confusion/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Displaying a location marker on a Google Map</title>
		<link>http://www.pcpro.co.uk/blogs/2010/12/23/displaying-a-location-marker-on-a-google-map/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/12/23/displaying-a-location-marker-on-a-google-map/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 12:54:54 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[google maps api]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=29482</guid>
		<description><![CDATA[
One of the most popular features on websites today is a marker pinpointing a location on Google Maps. It&#8217;s incredibly easy to add such a map to a website and I&#8217;m going to show you how.
I said it was easy, and with the recent release of version 3 of the Google Maps JavaScript API, it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/12/google-map.jpg" alt="Google Map" /></p>
<p>One of the most popular features on websites today is a marker pinpointing a location on Google Maps. It&#8217;s incredibly easy to add such a map to a website and I&#8217;m going to show you how.</p>
<p>I said it was easy, and with the recent release of version 3 of the Google Maps JavaScript API, it&#8217;s become even easier. With the previous version of this API, you had to register your map to receive an API key, but that&#8217;s now no longer necessary.</p>
<p>Naturally Google provide <a href="http://code.google.com/apis/maps/documentation/javascript/basics.html" target="_new">a comprehensive guide to the Maps API</a>, but I will run through the basics here.</p>
<p><span id="more-29482"></span></p>
<p><strong>Setting up the Map</strong></p>
<p>First of all you need to include the map API in your web page. This is done by adding the following line in the <code>&lt;head&gt;</code> element of your code:</p>
<pre><code>&lt;script
type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false"&gt;
&lt;/script&gt;</code></pre>
<p>You may notice the sensor parameter, which is set to false. This is a required parameter and should be set to &#8220;true&#8221; if the application used to determine the user&#8217;s location has a sensor device (e.g. a GPS locator). That&#8217;s not the case here, so we set it to false as shown.</p>
<p>Naturally, we need to define a map to display, but before we do that we need three things: somewhere on the web page to actually place the map, a default position to use as the map&#8217;s centre, and then some options to define the type of map that we require.</p>
<p>Setting up somewhere on the web page to place the map is a simple case of defining a div with a unique id, and some inline styling. So we have:</p>
<pre><code>&lt;div id="map" style="width:600px;
height:600px; margin-top:10px;"&gt;&lt;/div&gt;</code></pre>
<p>And that&#8217;s all we need.</p>
<p>To define a default position we need a latitude and longitude. There are plenty of websites out there that will convert addresses or places into coordinates for you, and I will centre this particular example on the <em>PC Pro </em>offices at latitude 51.515252 and longitude -0.189852. From these values a Google map position is defined by using the following:</p>
<pre><code>var latlngPos = new google.maps.LatLng(51.515252, -0.189852);</code></pre>
<p>We then set up the map options as follows:</p>
<pre><code>var myOptions = {
   zoom: 10,
   center: latlngPos,
   mapTypeId: google.maps.MapTypeId.ROADMAP
};</code></pre>
<p>Where <code>zoom</code> (naturally) indicates the zoom level of the map (you may want to play about with these to get the value that you want), <code>center</code> is set to the latitude/longitude position that we defined, and <code>mapTypeId</code> is set to the type of map that we wish to display initially. The map types are defined by the Google Maps API and are:</p>
<ul>
<li>MapTypeId.ROADMAP displays the default road map view</li>
<li>MapTypeId.SATELLITE displays Google Earth satellite images</li>
<li>MapTypeId.HYBRID displays a mixture of normal and satellite views</li>
<li>MapTypeId.TERRAIN displays a physical map based on terrain information</li>
</ul>
<p>Note: this simply defines the initial map type to display, the user can change it via a dropdown list that appears on the map itself. You can read more about the different map types over at <a href="http://code.google.com/apis/maps/documentation/javascript/maptypes.html" target="_new">Google</a> should you want to know more.</p>
<p>With these things done, we can now initialise our map as follows:</p>
<pre><code>var map = new google.maps.Map(document.getElementById("map"), myOptions);</code></pre>
<p>This will now cause the map to appear on your web page, contained within the map div (the map itself stays within the boundaries of the div&#8217;s dimensions).</p>
<p><strong>Marking the Location</strong></p>
<p>With the map set up, we can now go about defining the marker on the map that we want displayed. Once again we need to define a position for the Google map using latitude and longitude. I&#8217;m using the same values as above, as I want to place a marker on the <em>PC Pro</em> offices (it&#8217;ll help the staff when they stumble back from their Christmas party).</p>
<pre><code>var markerPos = new google.maps.LatLng(51.515252, -0.189852);</code></pre>
<p>Adding a marker to this location is as simple as:</p>
<pre><code>var marker = new google.maps.Marker({
   position: markerPos,
   map: map,
   title: "PC Pro Offices"
});</code></pre>
<p>(where map is the id of the map div)</p>
<p>As usual I have a <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/12/google-maps-simple-example.html">simple example</a> so that you can see it in action. (Note: this example also uses some jQuery)</p>
<p><strong>Going further</strong></p>
<p>The Google Map API is very powerful and you can go much further than I have shown here, such as adding pop-up information windows on the map marker.</p>
<p>You can even use the API to convert addresses into latitude/longitude positions and display them on the map. I have included a <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/12/google-maps-advanced-example.html">more advanced example</a> should you want to take a look at it. It&#8217;s pretty straightforward and I&#8217;ve commented the code in order to make it clearer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/12/23/displaying-a-location-marker-on-a-google-map/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Should you be using HTML5 today?</title>
		<link>http://www.pcpro.co.uk/blogs/2010/10/19/should-you-be-using-html5-today/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/10/19/should-you-be-using-html5-today/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 07:47:15 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[today]]></category>
		<category><![CDATA[usage]]></category>
		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=26572</guid>
		<description><![CDATA[
Despite all the hype about HTML5, there are still many people (mainly web developers!) out there who are wondering whether or not they should use it in their next site. The main issues seem to be browser compatibility and the myth that HTML5 won&#8217;t be ready for mainstream usage until 2022.
To begin with, let&#8217;s bust [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/10/html5-code.jpg" alt="html5 code" /></p>
<p>Despite all the hype about HTML5, there are still many people (mainly web developers!) out there who are wondering whether or not they should use it in their next site. The main issues seem to be browser compatibility and the myth that HTML5 won&#8217;t be ready for mainstream usage until 2022.</p>
<p>To begin with, let&#8217;s bust this myth once and for all. For any specification to be deemed &#8220;ready”, it supposedly needs to be fully implemented in two browsers. If this rule was true, CSS2.1 also wouldn&#8217;t be &#8220;ready&#8221;, and do you hear people advising you to hold off on using that? No, and quite rightly so too. And the same should go for HTML5.</p>
<p>As for browser compatibility, the latest versions of browsers such as Firefox, Chrome, Safari and Opera all support various parts of the HTML5 specification, and older versions of these browsers support bits of the spec. The major headache, as always, is Internet Explorer. However, with the upcoming release of Internet Explorer 9, which will support HTML5 features, this is improving. That said, there will of course be many people who remain on older versions of IE and how will they cope with HTML5?</p>
<p>Pretty well, actually, and there are a lot of things you can do to ensure browser compatibility.</p>
<p><span id="more-26572"></span><strong>New elements</strong></p>
<p>Whilst all of these browsers will happily accept the HTML5 doctype (<code>&lt;!DOCTYPE html&gt;</code>), Internet Explorer doesn&#8217;t understand any of the new elements and as such, will completely ignore them. This can be fixed using JavaScript. All you need to do is to add Remy Sharp&#8217;s <a href="http://remysharp.com/2009/01/07/html5-enabling-script/" target="_new">html5shiv script</a> to the head of your document, and IE versions 6 to 8 will know now what to do.</p>
<p>Some of the newer HTML5 elements &#8211; for example, input types such as email and url  - default to type text if the browser doesn&#8217;t understand them. So there&#8217;s no harm using them in your web page as a browser that takes advantage of them will do something funky, whereas a browser that doesn&#8217;t understand them will simply treat it as a normal text input field. Similarily input type attributes such as autofocus will simply be ignored by browsers that don&#8217;t know what to do with them.</p>
<p><strong>Styling</strong></p>
<p>Now that all browsers understand the elements, how will they look? There are no specific styles built into most of the browsers for these elements and thus they will all default to display:inline whereas some of them, e.g. section, article, head and footer need a default styling of <code>display:block</code>.</p>
<p>This is easily achieved by adding the following default CSS styles into your webpage:<br />
<code>article, aside, figure, footer, header, hgroup, menu, nav,</code><br />
<code>section { display:block; }</code></p>
<p><strong>HTML5 Reset</strong></p>
<p>Some developers like to use a CSS reset when starting a website from afresh, and this is usually a good idea as it allows all browsers to start with the same set of rules. There is a <a href="http://html5reset.org/" target="_new">HTML5 reset</a> available which you can use which will also automatically include the default styling above.</p>
<p><strong>Modernizr</strong></p>
<p><a href="http://www.modernizr.com" target="_new">Modernizr</a> by Paul Irish encompasses all this and also allows you to check browser compatibility for every HTML5 (and CSS3) feature on an individual basis. This can help with providing specific fallbacks for each HTML5 feature. It also adds some of the functionality mentioned above (creation of new elements for IE and default styling) automatically, so if you use Modernizr, you don&#8217;t have to add these separately.</p>
<p><a href="http://twitter.com">Twitter </a>, <a href="http://posterous.com/">posterous </a> and <a href="http://www.bk.com/">Burger King</a> are just three major sites out there currently using Modernizr on their website to check for various HTML5 and CSS3 functionality.</p>
<p><strong>No JavaScript?</strong></p>
<p>Of course most of these are bypassed when a user has turned off JavaScript, especially when using IE. This is an issue, for sure, and is something that the developer will have to decide on themselves. As usual, the <code>&lt;noscript&gt;</code> element can be used to target these users, and different markup and content could be delivered that doesn&#8217;t make use of HTML5 elements and features.</p>
<p><strong>Conclusion</strong></p>
<p>There are a whole host of websites out there using HTML5 already and most of them work just fine. There are sites out there dedicated to showcasing websites using HTML5, such as <a href="http://www.html5gallery.com" target="_new">HTML5 Gallery</a> and <a href="http://101besthtml5sites.com/" target="_new">101 Best HTML5 Sites</a>. They&#8217;re well worth taking a look at to see what others are doing.</p>
<p>Personally I think that there&#8217;s nothing to stop you from going out there and using HTML5 today<strong> </strong> in your websites. It works now<strong> </strong> and is only improving. So the answer to should you be using HTML5 today is a resounding yes!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/10/19/should-you-be-using-html5-today/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to store website data with HTML5</title>
		<link>http://www.pcpro.co.uk/blogs/2010/09/27/data-storage-with-html5/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/09/27/data-storage-with-html5/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 11:02:47 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[data storage]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[localStorage]]></category>
		<category><![CDATA[sessionStorage]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=25108</guid>
		<description><![CDATA[
Throughout your web browsing careers I&#8217;m sure you&#8217;ve come across the notion of cookies, pieces of text stored by the browser to be retrieved and used at a later date. These vary from simply remembering your name to welcome you personally next time you visit, to more complicated storage of authentication and shopping-cart contents.
Cookies generally [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/html5-storage.jpg" alt="html5 storage" width="462" height="300" /></p>
<p>Throughout your web browsing careers I&#8217;m sure you&#8217;ve come across the notion of cookies, pieces of text stored by the browser to be retrieved and used at a later date. These vary from simply remembering your name to welcome you personally next time you visit, to more complicated storage of authentication and shopping-cart contents.</p>
<p>Cookies generally work well but can be fiddly to implement, as they are set to be deleted by default once the browser is closed. If a website owner needs the data to be stored for a longer period, a cookie can be given an expiry date. Again this isn&#8217;t as clean as it could be: how far into the future do you set the date, for example? And what happens when a user flushes out their cookies?</p>
<p>HTML5 attempts to clean this up with the introduction of web storage.</p>
<p><span id="more-25108"></span></p>
<p><strong>Web Storage</strong></p>
<p>Web storage comes in two different types, <code>sessionStorage</code> and <code>localStorage</code>. As might be deduced from the names, <code>sessionStorage</code> is for storing data that&#8217;s required for a particular session only, and <code>localStorage</code> is for data that&#8217;s to remain indefinitely.</p>
<blockquote><p>Web storage correctly separates session data from long term data</p></blockquote>
<p>This does away with the need for expiry dates, and instantly makes it clearer which data is for when and for how long. It also makes it incredibly easy to implement.</p>
<p><strong>The API</strong></p>
<p>As both types are so similiar, they share the same API, which contains the following items and functions:</p>
<pre><code>// The number of items being stored
long length;

// To retrieve the item 'key' from storage
getItem(key);

// To set the item 'key' in storage with 'value'
setItem(key, value);

// To remove the item from storage
removeItem(key);

// To clear the entire storage
clear();</code></pre>
<p>It&#8217;s all quite simple and straightforward to use.</p>
<p><strong>Saying Hello</strong></p>
<p>Let&#8217;s say you wanted to store a user&#8217;s name to welcome them back later. Assuming the existence of a simple HTML5 page consisting of one input field called <code>name</code> and a link that calls the function <code>saveName()</code> it would be defined as follows:</p>
<pre><code>function saveName() {
   var name = document.getElementById('name').value;
   localStorage.setItem('username', name);
}</code></pre>
<p><code> </code></p>
<p>Each time this page loads, call a new function <code>sayHello()</code> which is defined as:</p>
<pre><code>function sayHello() {
   var userName = localStorage.getItem('username');
   if (userName != null) alert("Hello " + userName + " and welcome back!");
}</code></pre>
<p><code> </code></p>
<p>This will check for the existence of a username in <code>localStorage</code>, and if it&#8217;s there, will welcome the user.</p>
<p><em>Note that <code>localStorage</code> is used here rather than <code>sessionStorage</code> as we want the name to be displayed next time the user visits the page again, during which time they may have closed the browser, which would clear anything in <code>sessionStorage</code>.</em></p>
<p>You can see this working for yourself in this very simple <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/say-hello.html">&#8220;say hello&#8221; example</a>. Enter a name, click &#8217;save&#8217;, and reload the page.</p>
<p>If you enter a different name in the input field and click &#8217;save&#8217;, the existing value will be overwritten. We could also remove the item by calling <code>localStorage.removeItem('name');</code> which would remove that item only. The entire <code>localStorage</code> could be cleared by calling <code>localStorage.clear();</code></p>
<p><strong>Session storage</strong></p>
<p><code>sessionStorage</code> works in the exact same way, except that the data will be automatically cleared once the brower is closed.</p>
<p>You can also store multiple data items in web storage attached to the one key, but you will need to use a JavaScript object and something such as JSON which helps to &#8220;stringify&#8221; the stored data, thus facilitating its storage.</p>
<p><strong>Browser Support</strong></p>
<p>If you&#8217;re used to reading about Internet Explorer&#8217;s current inability to support any HTML5 feature, you&#8217;re in for a surprise here. Web storage is actually supported by IE8 as well as all the major browsers:</p>
<ul>
<li>Firefox 3.5+</li>
<li>Safari 4.0+</li>
<li>Chrome 4.0+</li>
<li>Opera 10.5+</li>
<li>Internet Explorer 8.0+</li>
<li>iPhone 2.0+</li>
<li>Android 2.0+</li>
</ul>
<p>So basically, you can start using it now!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/09/27/data-storage-with-html5/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Adding your Twitter feed to your website with jQuery</title>
		<link>http://www.pcpro.co.uk/blogs/2010/09/13/adding-your-twitter-feed-to-your-website-with-jquery/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/09/13/adding-your-twitter-feed-to-your-website-with-jquery/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 10:44:11 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=24427</guid>
		<description><![CDATA[
If you or your company has a Twitter account, chances are you&#8217;d like to promote it and display your latest tweets from your website. Since many websites &#8211; both personal and increasingly business &#8211; are built on blogging software such as WordPress, this is usually achieved via a plugin, of which there are many out [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-24547" src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/PC-Pro-Twitter-page--462x346.jpg" alt="PC Pro Twitter page" width="462" height="346" /></p>
<p>If you or your company has a Twitter account, chances are you&#8217;d like to promote it and display your latest tweets from your website. Since many websites &#8211; both personal and increasingly business &#8211; are built on blogging software such as WordPress, this is usually achieved via a plugin, of which there are many out there.</p>
<p>But what if you simply want to add your live Twitter feed to a &#8220;normal&#8221; web page? <a title="Twitter widgets" href="http://twitter.com/goodies/widgets" target="_blank">Twitter itself provides a number of HTML widgets</a>, but in this article I&#8217;ll show you how easy it is to achieve with a little bit of JavaScript, CSS, and jQuery.</p>
<p><span id="more-24427"></span></p>
<p>In case you haven&#8217;t come across it before:</p>
<p><strong>What is jQuery?</strong></p>
<p><a href="http://jquery.com/" target="_new">jQuery</a> is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. It&#8217;s very powerful and makes life a whole lot easier when writing JavaScript. To include jQuery in your webpage, simply add the following within the <code>&lt;head&gt;</code> tags:</p>
<p><code>&lt;script type="text/javascript" src="http://jqueryjs.google<br />
code.com/files/jquery-1.3.2.min.js"&gt;&lt;/script&gt;</code></p>
<p>This uses the version that is hosted on Google Code, which saves you having to download the file.</p>
<p><strong>Twitter API</strong></p>
<p>Twitter itself provides a complicated API to allow access to all sorts of things. A lot of this complication arises around authentication, and necessarily so, but thankfully to simply retrieve a stream of tweets, authentication isn&#8217;t required (as long as the user in question hasn&#8217;t hidden their tweets).</p>
<p>First of all the API provides many different ways to obtain a <a href="http://dev.twitter.com/doc/get/statuses/" target="_new">user&#8217;s statuses</a>. I won&#8217;t go into any of them other than the one that I favour, and this is the one that I&#8217;ll talk about here: <a href="http://dev.twitter.com/doc/get/statuses/user_timeline" target="_new">user_timeline</a>.</p>
<p><strong>user_timeline</strong></p>
<p>This returns a number of the most recent statuses posted by the user. It can return the data in different formats: XML, JSON, RSS and Atom. I favour  <a href="http://www.json.org/" target="_new">JSON</a>, a lightweight data-interchange format, so this is the one that I will talk about.</p>
<p>You can use a number of parameters, and a full list of what they can do can be found on the Twitter API description for <a href="http://dev.twitter.com/doc/get/statuses/user_timeline" target="_new">user_timeline</a>. For now, I will only use a few relevant ones.</p>
<p><strong>Give me the Tweets!</strong></p>
<p>To retrieve the data for a particular Twitter account (I will use <a href="http://twitter.com/pcpro" target="_new">pcpro</a> in this example here) you call the following:</p>
<p><code>$.getJSON("http://twitter.com/statuses/user_timeline.json?<br />
screen_name=pc_pro&amp;count=10&amp;callback=?",<br />
function(tweetdata) {<br />
   // do some stuff here<br />
});</code></p>
<p>This will return the last 10 tweets from the pc_pro account in JSON format in the <code>tweetdata</code> variable. By default, retweeted tweets are not included in this feed, but to include them, add the <code>&amp;include_rts=1</code> parameter above, and they will be returned.</p>
<p>Of course we now have to make sense of this data, parse it and actually do something with it.</p>
<p>On our HTML page, define a <code>&lt;ul&gt;</code> and give it the id <code>tweet-list</code>. This is where we will hold our tweets. The above code is then extended to do the following:</p>
<p><code>$.getJSON("http://twitter.com/statuses/user_timeline.json?screen_name=pc_pro&amp;count=1O&amp;callback=?", function(tweetdata) {<br />
   var tl = $("#tweet-list");<br />
   $.each(tweetdata, function(i,tweet) {<br />
      tl.append("&lt;li&gt;“" + tweet.text + "”– " + tweet.created_at + "&lt;/li&gt;");<br />
   });<br />
});</code></p>
<p>Some explanations: <code>var tl = $("#tweet-list");</code> grabs a reference to the <code>&lt;ul&gt;</code> element that we created above. We need this as we will add each tweet to it.</p>
<p><code>$.each(tweetdata, function(i,tweet) {...</code> is the start of a jQuery loop, in this case iterating through each item in <code>tweetdata</code> and storing it temporarily in <code>tweet</code>. The following line then adds the tweet within an <code>&lt;li&gt;</code> item.  The actual text of the tweet is contained within the <code>text</code> data member, and here we put double quotes around it, and the time it was created is contained within the <code>created_at</code> data member.</p>
<p>This will now display the last 10 tweets in list format on the relevant HTML page.</p>
<p>However, if there are links contained in the tweet, they won&#8217;t be clickable, and the created date is a bit long and not like the Twitter standard timelines such as &#8220;about a minute ago&#8221; or &#8220;two hours ago&#8221;. We can fix this with the following two functions <code>urlToLink();</code> which we call on <code>tweet.text</code>:</p>
<p><code>function urlToLink(text) {<br />
   var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;@#\/%=~_|])/ig;<br />
   return text.replace(exp,"&lt;a href='$1'&gt;$1&lt;/a&gt;");<br />
}</code></p>
<p>and <code>relTime();</code> which we call on <code>tweet.created_at</code>:</p>
<p><code>function relTime(time_value) {<br />
   time_value = time_value.replace(/(\+[0-9]{4}\s)/ig,"");<br />
   var parsed_date = Date.parse(time_value);<br />
   var relative_to = (arguments.length &gt; 1) ? arguments[1] : new Date();<br />
   var timeago = parseInt((relative_to.getTime() - parsed_date) / 1000);<br />
   if (timeago &lt; 60) return 'less than a minute ago';<br />
   else if(timeago &lt; 120) return 'about a minute ago';<br />
   else if(timeago &lt; (45*60)) return (parseInt(timeago / 60)).toString() + ' minutes ago';<br />
   else if(timeago &lt; (90*60)) return 'about an hour ago';<br />
   else if(timeago &lt; (24*60*60)) return 'about ' + (parseInt(timeago / 3600)).toString() + ' hours ago';<br />
   else if(timeago &lt; (48*60*60)) return '1 day ago';<br />
   else return (parseInt(timeago / 86400)).toString() + ' days ago';<br />
}</code></p>
<p>So we need to change the above line to the following:</p>
<p><code>tl.append("&lt;li&gt;“" + urlToLink(tweet.text) + "”– " + relTime(tweet.created_at) + "&lt;/li&gt;");</code></p>
<p>This will be called when the HTML page is loaded (or you can load it some other time, it&#8217;s up to you of course) and this is done using jQuery by inserting the code within:</p>
<p><code>$(document).ready(function() {<br />
   // code here<br />
});</code></p>
<p>which basically calls the code when the entire DOM has been loaded.</p>
<p><strong>End Result</strong></p>
<p>I have put together an <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/twitter-api-test3.html">example</a> using all the code above, so you can see all this together and working for yourself. Plus you can <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/twitter-api-test3-view.html">view the code</a> to see how it&#8217;s done. It&#8217;s all commented too, probably overly so, in case you get stuck.</p>
<p>You can of course also style the list and its contents with CSS, but I&#8217;ll leave that as an exercise for the reader.</p>
<p><strong>*Update*</strong></p>
<p>One of the comments below asked about retrieving the latest statuses from a specific account&#8217;s list. I&#8217;ve created a quick example that <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/twitter-api-list-test2.html">retrieves and displays the latest updates</a> from PC Pro&#8217;s &#8217;staff&#8217; Twitter list. You can of course <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/09/twitter-api-list-test-view2-view.html">view</a> the source code.</p>
<p>The main difference is the URL in included in the <code>&amp;.getJSON()</code> call which should be:</p>
<p><code>http://api.twitter.com/1/<strong>account-name</strong>/lists/<strong>list-name</strong>/statuses.json?callback=?</code></p>
<p>where <code>account-name</code> is the name of the account, in this case <code>pc_pro</code>, and <code>list-name</code> is the name of the list, in this case <code>staff</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/09/13/adding-your-twitter-feed-to-your-website-with-jquery/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Adding audio to your website with HTML5</title>
		<link>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/#comments</comments>
		<pubDate>Mon, 23 Aug 2010 09:25:52 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[html5]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=22981</guid>
		<description><![CDATA[
With all the furore around the HTML5 video element, the poor audio element sits in the background wondering what it&#8217;s done wrong to receive so little attention. So in an attempt to redress the balance, I&#8217;m going to show you how you can stream audio to your website visitors without any additional plugins.
As with the video [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/08/gramaphone-2.jpg" alt="old gramaphone" /><br />
With all the furore around the HTML5 <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video element</a>, the poor audio element sits in the background wondering what it&#8217;s done wrong to receive so little attention. So in an attempt to redress the balance, I&#8217;m going to show you how you can stream audio to your website visitors without any additional plugins.</p>
<p>As with the video element, in the past the only method of embedding audio files into a web page was to use Flash or another third-party plugin. There simply was no other way. With the introduction of the audio element, this has changed.</p>
<p><span id="more-22981"></span></p>
<p><strong>Browsers and file types</strong></p>
<p>There are currently three different audio file types that are supported, and (of course) the different browsers each support different formats. The table below illustrates this:</p>
<table style="text-align: center;margin: 20px 0" border="0">
<thead>
<tr style="margin: 6px 0">
<th></th>
<th>Vorbis OGG</th>
<th>MP3</th>
<th>WAV</th>
</tr>
</thead>
<tbody>
<tr style="margin: 6px 0">
<td style="text-align:left">Firefox 3.6.8</td>
<td>✓</td>
<td>x</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Chrome 5</td>
<td>✓</td>
<td>✓</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Safari 5</td>
<td>x</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Opera 10.6</td>
<td>✓</td>
<td>x</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Internet Explorer 8</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Internet Explorer 9</td>
<td>x</td>
<td>✓</td>
<td>x</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">iPhone</td>
<td>x</td>
<td>✓</td>
<td>✓</td>
</tr>
<tr style="margin: 6px 0">
<td style="text-align:left">Android</td>
<td>x</td>
<td>x</td>
<td>x</td>
</tr>
</tbody>
</table>
<p><strong>Code</strong></p>
<p>So how do we actually go about adding an audio file to a web page? Well it&#8217;s quite simple really, especially if you&#8217;ve already used the <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video</a> element.</p>
<p>Instead of using the &lt;<code>video&gt;</code> element we naturally use its brother, the <code>&lt;audio&gt;</code> element. Like the <code>&lt;video&gt;</code> element, we can use the <code>src</code> attribute to directly specify the audio file to play, but, as shown above, it&#8217;s more practical to use the <code>&lt;source&gt;</code> element to indicate a number of possible sources in order to cover <del datetime="2010-08-21T07:27:38+00:00">all</del> most browsers.</p>
<p><strong>The &lt;audio&gt; element</strong></p>
<p>The <code>audio</code> element takes the following attributes:</p>
<table style="text-align:left;padding-right:5px" border="0" width="400px">
<thead>
<tr style="background-color:#e2001a;color:#fff">
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">src</td>
<td style="padding-left:5px">a valid URL to the audio file itself</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">preload</td>
<td style="padding-left:5px">Specifies if the audio is to be preloaded or not. Possible values:</p>
<ul style="padding-left:15px;color:#222">
<li>auto &ndash; loads the entire audio file when the page loads</li>
<li>meta &ndash; only load the audio files meta data when the page loads</li>
<li>none &ndash; don&#8217;t load the audio file when the page loads</li>
</ul>
</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">autoplay</td>
<td style="padding-left:5px">a boolean indicating whether the audio file should be played automatically</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">controls</td>
<td style="padding-left:5px">a boolean indicating that the default media controls should be displayed by the browser</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">loop</td>
<td style="padding-left:5px">a boolean indicating whether the audio file should be played repeatedly (this is evil)</td>
</tr>
</tbody>
</table>
<p>So you can easily add a WAV audio file to your website by using the following markup:</p>
<p><code>&lt;audio src="audioFile.wav" autoplay controls&gt;&lt;/audio&gt;</code></p>
<p>Of course, as mentioned above, this can limit your browser compatibility and it&#8217;s better to provide different audio sources using the <code>&lt;source&gt;</code> element.</p>
<p><strong>The &lt;source&gt; element</strong></p>
<p>The <code>source</code> element can take the following attributes:</p>
<table style="text-align:left;padding-right:5px" border="0" width="400px">
<thead>
<tr style="background-color:#e2001a;color:#fff">
<th>Attribute</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">src</td>
<td style="padding-left:5px">a valid URL to the media (in this case audio) file itself</td>
</tr>
<tr style="background-color:#ddd">
<td style="padding-left:5px" valign="top">type</td>
<td style="padding-left:5px">the type of the media file which must be a <a href="http://www.webmaster-toolkit.com/mime-types.shtml" target="new">MIME type</a>, e.g. <code>type="audio/ogg"</code> indicates that it is a Vorbis OGG audio file, and you can also provide the MIME codec to help the browser to decide how to play the audio by using <code>type='audio/ogg; codecs="vorbis"</code>.</td>
</tr>
</tbody>
</table>
<p><strong>Stacking the audio sources</strong></p>
<p>Combining the <code>&lt;audio&gt;</code> and <code>&lt;source&gt;</code> elments together couldn&#8217;t be simpler, as the code below shows:</p>
<p><code>&lt;audio controls autobuffer&gt;<br />
&lt;source src="audioFile.ogg"&gt;<br />
&lt;source src="audioFile.mp3"&gt;<br />
&lt;source src="audioFile.wav"&gt;<br />
Sorry, your browser does not support the audio element<br />
&lt;/audio&gt;</code></p>
<p>The code above should play the specified audio file in all of the browsers mentioned above (except for the current incarnations of Internet Explorer and Android &#8211; which will display the message indicating as much. This could be replaced with a Flash fallback of course).</p>
<p>Feel free to <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/08/html5-audio-test-2.html">test this code for yourself</a>.</p>
<p><strong>Conclusion</strong></p>
<p>So there it is in its simplest form, adding an audio file to a web page. Of course it depends on the browser the page is being viewed in, and, as usual, we&#8217;re still waiting for Internet Explorer to catch up (A beta version of IE9 is due out next month).  Nevertheless, it&#8217;s still worth using today. Just don&#8217;t set your files to autoplay!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/08/23/adding-audio-to-your-website-with-html5/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Seven of the best HTML5 resources</title>
		<link>http://www.pcpro.co.uk/blogs/2010/08/02/seven-of-the-best-html5-resources/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/08/02/seven-of-the-best-html5-resources/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 09:40:33 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[resources]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=20998</guid>
		<description><![CDATA[There are plenty of articles out there that explain the principles of HTML5, including Davey Winder&#8217;s Everything you need to know about HTML5.
But how do you actually go about using it? This article introduces my recommended list of HTML5 resource websites, where a large number of tutorials, experiments, information and examples on using the various bits and [...]]]></description>
			<content:encoded><![CDATA[<p>There are plenty of articles out there that explain the principles of HTML5, including Davey Winder&#8217;s <a href="http://www.pcpro.co.uk/features/359536/everything-you-need-to-know-about-html5">Everything you need to know about HTML5</a>.</p>
<p>But how do you actually go about using it? This article introduces my recommended list of HTML5 resource websites, where a large number of tutorials, experiments, information and examples on using the various bits and pieces of HTML5 can be found.</p>
<p><a href="http://html5doctor.com/" target="new"><br />
</a></p>
<p><a href="http://html5doctor.com/" target="new"></a></p>
<p><a href="http://html5doctor.com/" target="new"></a></p>
<p><a href="http://html5doctor.com/" target="new"></a></p>
<p><a href="http://html5doctor.com/" target="new"></a></p>
<p><a href="http://html5doctor.com/" target="new"> </a></p>
<p><a href="http://html5doctor.com/" target="new"></p>
<h2>HTML5 Doctor</h2>
<p></a><br />
<a href="http://html5doctor.com/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/html5doctor.png" alt="HTML5 Doctor" width="462" height="200" /></a><br />
HTML5 Doctor is a collaboration featuring some of the top advocates of HTML5, notably <a href="http://www.brucelawson.co.uk/" target="_new">Bruce Lawson</a>, <a href="http://remysharp.com/" target="_new">Remy Sharp</a>, and <a href="http://richclarkdesign.com/" target="_new">Rick Clark</a>.  On the site you&#8217;ll find articles relating to HTML5, its semantics, and most importantly, how to use it right now. In addition, they also invite users to ask questions which they answer at regular intervals.</p>
<p><a href="http://diveintohtml5.org/" target="_new"><span id="more-20998"></span><br id="__mce" /></a></p>
<p><a href="http://diveintohtml5.org/" target="_new"></a></p>
<p><a href="http://diveintohtml5.org/" target="_new"></a></p>
<p><a href="http://diveintohtml5.org/" target="_new"></a></p>
<p><a href="http://diveintohtml5.org/" target="_new"></a></p>
<p><a href="http://diveintohtml5.org/" target="_new"> </a></p>
<p><a href="http://diveintohtml5.org/" target="_new"></p>
<h2>Dive Into HTML5</h2>
<p></a><br />
<a href="http://diveintohtml5.org/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/diveintohtml5.png" alt="Dive Into HTML5" height="200" /></a><br />
<a title="Mark Pilgrim" href="http://diveintomark.org/about" target="_blank">Mark Pilgrim&#8217;s</a> site (which will eventually appear as a book that can be <a title="Amazon" href="http://www.amazon.co.uk/HTML5-Up-Running-Mark-Pilgrim/dp/0596806027?ie=UTF8&amp;tag=diveintomark-20&amp;creativeASIN=0596806027" target="_blank">pre-ordered here</a>) “seeks to elaborate on a hand-picked Selection of features from the HTML5 specification and other fine standards.” Here you will find in-depth articles on varying parts of the HTML5 specification and explanations of their importance.</p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"><br />
</a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"></a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"></a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"></a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"></a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"> </a></p>
<p><a href="http://www.focus.com/images/view/11905/" target="_new"></p>
<h2>WTF is HTML5 and Why We Should All Care – Infographic</h2>
<p></a><br />
<a href="http://www.focus.com/images/view/11905/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/wtfishtml5.png" alt="wtf is html5" width="462" height="200" /></a><br />
This site is an  infographic that helps to explain HTML5 in a nutshell. If you&#8217;re looking for a quick explanation of what HTML5 is all about, including browser compatibility and the most important additions to the specification, this is the place to go.</p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"><br />
</a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"></a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"></a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"></a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"></a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"> </a></p>
<p><a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"></p>
<h2>HTML5 Pocket Book</h2>
<p></a><br />
<a href="http://adactio.com/extras/pocketbooks/html5/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/html5pocketbook.png" alt="HTML5 Pocket Book" width="462" height="200" /></a><br />
A quick pocket guide to the main HTML5 elements and how to use them. Written by <a href="http://adactio.com/" target="_new">Jeremy Keith</a> (author of the recentlry released <a href="http://books.alistapart.com/product/html5-for-web-designers" target="_new">HTML5 for Web Designers</a>), this is ideal as a quick reference guide on how and when to use new HTML5 elements such as &lt;header&gt;, &lt;hgroup&gt;, &lt;article&gt;, and &lt;section&gt;.</p>
<p><a href="http://www.html5rocks.com/" target="_new"><br />
</a></p>
<p><a href="http://www.html5rocks.com/" target="_new"></a></p>
<p><a href="http://www.html5rocks.com/" target="_new"></a></p>
<p><a href="http://www.html5rocks.com/" target="_new"></a></p>
<p><a href="http://www.html5rocks.com/" target="_new"></a></p>
<p><a href="http://www.html5rocks.com/" target="_new"> </a></p>
<p><a href="http://www.html5rocks.com/" target="_new"></p>
<h2>HTML5 Rocks</h2>
<p></a><br />
<a href="http://www.html5rocks.com/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/html5rocks.png" alt="HTML5 Rocks" width="462" height="200" /></a><br />
Released by Google, this site is a developer resource site devoted to HTML5 technologies. The site itself is split into four different sections: presentation &#8211; which contains an introduction to HTML5 slideshow; playground &#8211; which has examples of how to use HTML5 that you can try yourself; tutorials &#8211;  which contains links to other HTML5 tutorials; and finally, resources &#8211;  which naturally links to other HTML5-related sites.</p>
<p><a href="http://html5demos.com/" target="_new"><br />
</a></p>
<p><a href="http://html5demos.com/" target="_new"></a></p>
<p><a href="http://html5demos.com/" target="_new"></a></p>
<p><a href="http://html5demos.com/" target="_new"></a></p>
<p><a href="http://html5demos.com/" target="_new"></a></p>
<p><a href="http://html5demos.com/" target="_new"> </a></p>
<p><a href="http://html5demos.com/" target="_new"></p>
<h2>HTML5 Demos and Examples</h2>
<p></a><br />
<a href="http://html5demos.com/" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/html5demos.png" alt="HTML5 Demos and Examples" width="462" height="200" /></a><br />
Written and maintained by <a href="http://remysharp.com/" target="_new">Remy Sharp</a> (one of the HTML5 Doctors mentioned above), this site is rich with working demos and examples of HTML5 features. Want to see how websockets can be used for a simple chat client? Or how GeoLocation can find where you are? Or even how drag and drop works? This is the site for you.</p>
<p><a href="http://html5laboratory.com" target="_new"><br />
</a></p>
<p><a href="http://html5laboratory.com" target="_new"></a></p>
<p><a href="http://html5laboratory.com" target="_new"></a></p>
<p><a href="http://html5laboratory.com" target="_new"></a></p>
<p><a href="http://html5laboratory.com" target="_new"></a></p>
<p><a href="http://html5laboratory.com" target="_new"> </a></p>
<p><a href="http://html5laboratory.com" target="_new"></p>
<h2>HTML5 Laboratory</h2>
<p></a><br />
<a href="http://html5laboratory.com" target="_new"><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/html5laboratory.png" alt="HTML5 Laboratory" width="462" height="200" /></a><br />
And last but not least I include my own site which I use for simple HTML5 related experiments. On this site I aim to show, in as simple a manner as possible, how some of the new HTML5 elements and JavaScript APIs can be implemented right now.</p>
<p><strong>See how others are using HTML5</strong></p>
<p>There are also a number of HTML5 gallery sites out there than showcase some of the HTML5 sites that are out there right now. These are great for seeing how others are currently using HTML5 in the real world.</p>
<ul>
<li><a href="http://www.html5gallery.com" target="_new">HTML5 Gallery</a></li>
<li><a href="http://www.101besthtml5sites.com" target="_new">101 Best HTML5 Sites</a></li>
<li><a href="http://www.html5sites.com" target="_new">HTML5 Sites</a></li>
<li><a href="http://www.html5websites.net" target="_new">HTML5 Websites</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/08/02/seven-of-the-best-html5-resources/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to make your website more attractive with @font-face</title>
		<link>http://www.pcpro.co.uk/blogs/2010/07/15/embedding-fonts-in-web-pages-using-font-face/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/07/15/embedding-fonts-in-web-pages-using-font-face/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 10:42:25 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[@font-face]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=19495</guid>
		<description><![CDATA[
photo by Kriss Szkurlatowski
In my last blog entry I briefly mentioned CSS3 when talking about the confusion surrounding HTML5. In this post, I&#8217;m going to talk about one of the new features of CSS3 and one which will possibly be noticed most by the non-web developer.
Allow me to introduce @font-face.

What does @font-face do?
It allows a [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/typewriter-type.jpg" alt="typewriter type" width="462" height="200" /></p>
<div style="margin-top:-20px;margin-bottom:10px;font-size:10px;color:#aaa">photo by Kriss Szkurlatowski</div>
<p>In my <a href="http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/">last blog entry</a> I briefly mentioned CSS3 when talking about <a href="http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/">the confusion surrounding HTML5</a>. In this post, I&#8217;m going to talk about one of the new features of CSS3 and one which will possibly be noticed most by the non-web developer.</p>
<p>Allow me to introduce @font-face.</p>
<p><span id="more-19495"></span></p>
<p><strong>What does @font-face do?</strong></p>
<p>It allows a web developer to embed a font within a web page and display it to the user. So instead of the bog standard fonts that are normally found on websites, you can now see much fancier and prettier fonts.</p>
<p><strong>A brief history</strong></p>
<p>The @font-face <abbr title="Cascading Style Sheets">CSS</abbr> rule was first introduced in the <a href="http://www.w3.org/TR/2008/REC-CSS2-20080411/fonts.html#font-descriptions" target="_new">CSS 2.0 specification</a> and then removed in <a href="http://www.w3.org/TR/CSS2/fonts.html" target="_new">CSS 2.1</a>, before being reintroduced in <a href="http://www.w3.org/TR/css3-fonts/#the-font-face-rule" target="_new">CSS 3.0</a>. The fact that it existed in CSS 2.0 is important, because it means that even legacy browsers such as Internet Explorer 6 (the bane of many a web developer&#8217;s life) support it.</p>
<blockquote><p>the @font-face rule was first introduced in the CSS 2.0 specification</p></blockquote>
<p><strong>Issues</strong></p>
<p>As is usual with such things, there are some issues with regards to implementing @font-face. First of all, as is customary in the world of web development, different browsers support different formats. Why these guys can&#8217;t seem to agree on the same format for anything is a mystery to me. So this means that a font defined with @font-face needs to be made available in different formats to be usable by each of the major browsers.</p>
<p>Secondly, not all fonts can be used legally in this manner. As @font-face downloads the required font from the server (where the site is hosted) to the user&#8217;s personal machine, the font licence needs to allow this free distribution of fonts. Thankfully there are many font developers out there who are now beginning to release their fonts with the required licence.</p>
<p><strong>Using @font-face</strong></p>
<p>So how can you use @font-face to embed an attractive typeface in your website? The answer is very easily.</p>
<p>First of all you need to pick a font, and ensure that it has the required licence. The best place to go for a comprehensive list of such fonts is <a href="http://www.fontsquirrel.com/fontface" target="_new">Font Squirrel</a>. (Incidentally, the site also has a <a href="http://www.fontsquirrel.com/fontface/generator" target="_new">@font-face Kit Generator</a> which allows you to upload fonts, and I highly recommend using it.)</p>
<p>For this demo I have chosen <a href="http://www.fontsquirrel.com/fonts/Hattori-Hanzo" target="_new">Hattori Hanzo</a> from Font Squirrel and downloaded the <a href="http://www.fontsquirrel.com/fontfacekit/Hattori-Hanzo">font kit</a>. The kit is a ZIP file that will contain a number of files, most of which are the fonts themselves in different formats, which are:</p>
<ul>
<li><abbr><strong>EOT</strong></abbr> – the font format used by Microsoft and supported from IE 4+</li>
<li><abbr><strong>TTF</strong></abbr> – the outline font standard originally developed by Apple and supported by Firefox 3.5+, Opera 10+, Safari 3.1+ and Chrome 4.0.249.4+</li>
<li><abbr title="Scalable Vector Graphics"><strong>SVG</strong></abbr> – SVG uses <abbr title="eXtensible Markup Language">XML</abbr> to describe 2D graphics and here, font characters, for the iPad and iPhone</li>
<li><abbr title="Web Open Font Format"><strong>WOFF</strong></abbr> – is a repackaged version of a TrueType or OpenType font in a compressed form and is supported by Firefox 3.6+, IE9 and Chrome 5+</li>
</ul>
<p>As shown above, different browsers support different font formats, and the @font-face CSS rule will reflect this. Included with the @font-face kit will be a CSS file which will contain this rule. Let&#8217;s take a look at the one that comes with the Hattori Hanzo font. It contains two font rule declarations, one for <em>HattoriHanzoLight</em> and another for <em>HattoriHanzoLightItalic</em>. Both declarations are the same and simply reference different files, so I will only go through the first:</p>
<p><code>@font-face {<br />
font-family: 'HattoriHanzoLight';<br />
src: url('Hattori_Hanzo-webfont.eot');<br />
src: local('?'), url('Hattori_Hanzo-webfont.woff')<br />
format('woff'), url('Hattori_Hanzo-webfont.ttf')<br />
format('truetype'),<br />
url('Hattori_Hanzo-webfont.svg#webfontwDgCZ3F8')<br />
format('svg');<br />
font-weight: normal;<br />
font-style: normal;<br />
}</code></p>
<p>The first part of the @font-face declaration indicates the font-family, in this case <em>HattoriHanzoLight</em>. This will be the name that is used throughout the CSS file to indicate that this @font-face declaration is to be used.</p>
<p>Next is the EOT declaration. This needs to be the first <code>src</code> declaration otherwise Internet Explorer won&#8217;t find it and will break. As you can see, it simply points at the font file to use.</p>
<p>The third declaration <code>local('?')</code> tells the browser to check the local system for the font first. If the user has already installed it, then that one will be used. Otherwise the declarations that follow it will be downloaded in whatever format the browser understands.</p>
<p>All you need to do to apply this font to any normal CSS declaraion is to assign the appropriate name to the <code>font-family</code> attribute. For example:</p>
<p><code>p {<br />
font-family: 'HattoriHanzoLight';<br />
font-size: 16px;<br />
font-weight: normal;<br />
}</code></p>
<p>That&#8217;s it really. Quite simple. I have created a <a href="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/07/font-face-hattori-hanzo-demo.html">demo page for @font-face and Hattori Hanzo Light</a> for you to see the font in action.</p>
<p><strong>Conclusion</strong></p>
<p>For many, @font-face won&#8217;t seem like a big deal. And the fact that the different font formats are rendered differently on the various browsers, with varying degrees of success, may dampen the effect that embedding fonts within a webpage may have. I, on the other hand, believe it to be a big step forward in allowing web developers and designers to produce better looking sites and interfaces that will benefit the end user.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/07/15/embedding-fonts-in-web-pages-using-font-face/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The confusion surrounding HTML5</title>
		<link>http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/</link>
		<comments>http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 11:15:51 +0000</pubDate>
		<dc:creator>Ian Devlin</dc:creator>
				<category><![CDATA[Real World Computing]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.pcpro.co.uk/blogs/?p=18532</guid>
		<description><![CDATA[
There seems to be a lot of confusion lately with regards to what HTML5 actually is. Those in the web development community generally have a good idea of what it entails, if not the nitty-gritty, at least what it may contain. Not so outside of the web development world.
As generally tends to happen, external parties [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pcpro.co.uk/blogs/wp-content/uploads/2010/06/question-mark.jpg" alt="question mark" /></p>
<p>There seems to be a lot of confusion lately with regards to what HTML5 actually is. Those in the web development community generally have a good idea of what it entails, if not the nitty-gritty, at least what it may contain. Not so outside of the web development world.</p>
<p>As generally tends to happen, external parties grab hold of these new phrases, half-heartedly look into what they mean, jumble them together and cause a wave of confusion. The latest wave is the lumping together of HTML5 and <abbr title="Cascading Style Sheets 3">CSS3</abbr> into the general heading of HTML5.<span id="more-18532"></span></p>
<p>This is misleading.</p>
<p><strong>So what is HTML5 then?</strong></p>
<p>HTML5 is basically an emerging standard that is intending to replace the current versions of HTML (4.01) and XHTML (1.1). It introduces new markup elements and attributes that can be used for describing the structure of a HTML document in <a href="http://www.html5laboratory.com/writing-a-valid-html5-document.php" target="new">a more defined way</a> than is currently available. It also adds the embedding of <a href="http://www.pcpro.co.uk/blogs/2010/05/18/adding-video-to-your-website-with-html5/">video files</a> and audio files into a web document.</p>
<blockquote><p>HTML is  the language for describing the structure of web pages</p></blockquote>
<p>As well as new elements, there are new JavaScript APIs that allow such functionality as drag and drop, local file storage, web <abbr title="Structured Query Language">SQL</abbr>, 2D drawing (via the <code>&lt;canvas&gt;</code> element) and file access.</p>
<p><strong>And CSS3?</strong></p>
<p>Like the current version of CSS (2.1), CSS3 allows you to define the presentation of web pages. CSS3 however, introduces a huge variety of new ways to present your designs. It also introduces the idea of &#8220;modules&#8221; such as box, lists, hyperlinks, background and text. Each module will provide styling control over a certain type of content.</p>
<blockquote><p>CSS is the language for describing the presentation of web pages, including colors, layout, and fonts</p></blockquote>
<p>It also introduces new effects such as rounded borders, gradients, and box shadows, all effects that currently require fancy JavaScript or hacky combinations of HTML and CSS in order to achieve them. These will now be available through simple CSS definitions. Of course there are plenty more, this is just one example of the kind of thing that will be available for use.</p>
<p><strong>They&#8217;re not the same</strong></p>
<p>See the difference there? HTML is for structure, CSS for presentaion. So in the same way that the current version of HTML (4.01 or XHTML 1.1) is used for structuring a web document, and the current version of CSS (2.1) is used for styling a web document, both HTML5 and CSS3 have the same roles. This hasn&#8217;t changed.</p>
<p>They are exclusive of one another. HTML 4.01 can be used with CSS3, HTML5 with CSS 2.1, HTML5 with CSS3, any combination (although the browser needs to support them).</p>
<p><strong>So where has the confusion come from?</strong></p>
<p>The biggest culprit in my eyes is Apple. When they released their <a href="http://www.apple.com/html5">HTML5 Demos</a>, people very easily got the wrong end of the stick. This wasn&#8217;t done intentionally by Apple, but such is their worldwide appeal and influence, that many people&#8217;s first introduction to HTML5 was via Apple&#8217;s demos &#8211; that, out of seven demos, only two are HTML5 specific.</p>
<p>Don&#8217;t get me wrong, I like what Apple have done with these demos (other than forcing you to use Safari in order to view them), and all the demos are coded in HTML5 and use a variety of the new HTML5 elements. What annoys me is the the way they were presented to the public &#8211; under the name of HTML5 Showcase. Even the link is misleading. I&#8217;m all for promoting HTML5, but it needs to be done properly.</p>
<p>An example of the confusion that reigned (this was prior to the Apple HTML5 demo release) can be seen in The Guardian&#8217;s technology blog article <a href="http://www.guardian.co.uk/technology/blog/2010/may/26/html5-solar-system-demonstration" target="new">A working web version of the solar system &#8211; in HTML5, not Flash</a>. It&#8217;s been corrected now, thankfully, but it illustrates the confusion that existed then, and largely still exists now.</p>
<p><strong>Conclusion</strong></p>
<p>People need to be educated properly as to what any new emerging technologes actually are and what they are used for. Misleading the public will only lead to problems and misunderstandings as to what can do what and how, causing all sorts of issues between clients and web designers/developers who I&#8217;m sure are already dreading being asked: “This design is a bit bland. Can you add some HTML5?”</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pcpro.co.uk/blogs/2010/06/22/the-confusion-surrounding-html5/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

