<?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 5 Tutorial &#187; Examples</title>
	<atom:link href="http://html5tutorial.net/category/examples/feed" rel="self" type="application/rss+xml" />
	<link>http://html5tutorial.net</link>
	<description>Tutorials, Tips &#38; News for the Designer</description>
	<lastBuildDate>Sat, 24 Jul 2010 09:48:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Working with HTML5 localStorage()</title>
		<link>http://html5tutorial.net/tutorials/working-with-html5-localstorage.html</link>
		<comments>http://html5tutorial.net/tutorials/working-with-html5-localstorage.html#comments</comments>
		<pubDate>Tue, 11 May 2010 09:41:40 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[HTML 5 Attributes]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[html5 localstorage()]]></category>
		<category><![CDATA[localStorage()]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=397</guid>
		<description><![CDATA[HTML5 is fast approaching and getting wide spread usage. Most are familiar with the new tags like header, section and footer and everybody is aware of the new video tags thanks to Apple vs Adobe. However, there is a lot more to HTML5 those just those two aspects. I want to focus on localStorage() this [...]]]></description>
			<content:encoded><![CDATA[<p>HTML5 is fast approaching and getting wide spread usage. Most are familiar with the new tags like header, section and footer and everybody is aware of the new video tags thanks to Apple vs Adobe. However, there is a lot more to HTML5 those just those two aspects.</p>
<p>I want to focus on <a href="http://dev.w3.org/html5/webstorage/#the-localstorage-attribute" target="_blank">localStorage()</a> this time. localStorage is a client-side key-value database, meaning it is stored in the users browser. This means the users data is saved on their machine inside their browser. This also means that their data is only available to them when on that machine and in that browser. Remember that localStorage is per browser not per computer.</p>
<p>Browser support is always a huge topic when discussing new html5 or even css3 aspects. This is due to such a wide spread of support from the big browsers right now. In the case of localStorage, it is supported by Safari 4+, Mobile Safari (iPhone/iPad), Firefox 3.5+, Internet Explorer 8+ and Chrome 4+. This only leaves out Opera who currently does not support this storage. Depending on your target audience browser support may be an issue for you.</p>
<p><a href="http://paperkilledrock.com/2010/05/html5-localstorage-part-one/" target="_blank">HTML5 localStorage()</a> is a four part series of articles where I will show you how to create a simple html5 time tracking web app using localStorage as the sole database. The series will walk you through the basics of localStorage to advanced techniques to leverage the power of this new html5 database. We won&#8217;t stop at just the functionality of the app but in part four we will cover styling the app with html5 and css3 to create an iPhone(ish) web app.</p>
<p>Here is a quick example of what the javascript looks like to access localStorage();</p>
<div class='stb-alert_box' ><br />
if (typeof(localStorage) == &#8216;undefined&#8217; ) {<br />
alert(&#8216;Your browser does not support HTML5 localStorage. Try upgrading.&#8217;);<br />
} else {<br />
try {<br />
localStorage.setItem(&#8220;name&#8221;, &#8220;Hello World!&#8221;); //saves to the database, &#8220;key&#8221;, &#8220;value&#8221;<br />
} catch (e) {<br />
if (e == QUOTA_EXCEEDED_ERR) {<br />
alert(&#8216;Quota exceeded!&#8217;); //data wasn&#8217;t successfully saved due to quota exceed so throw an error<br />
}<br />
}</p>
<p>document.write(localStorage.getItem(&#8220;name&#8221;)); //Hello World!<br />
localStorage.removeItem(&#8220;name&#8221;); //deletes the matching item from the database<br />
}<br />
</div>
<p>In the code snippet above we are doing several things including checking if your browser supports localStorage, saving a new item to the database, retrieving that item and displaying it and then removing the item. The above is your typical Hello World example but shows you just how easy it is to use. The time tracking app we will create will be storing a unique id as the key and joining multiple values into one string, as localStorage only supports storing of strings. I will be making the source code available at the end of each article along with the full source and the working app at the end of the series, <a href="http://paperkilledrock.com/2010/05/html5-localstorage-part-one/" target="_blank">which you can follow here</a>.</p>
<p>&#8221; Written for HTML5Tutorial.net by <a href="http://jamesfleeting.com" target="_blank">James Fleeting</a>, a web designer and developer obsessed with the future of the web working at Crane | West Advertising Agency in Wichita Falls, Texas. &#8220;</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/tutorials/working-with-html5-localstorage.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Canvas examples</title>
		<link>http://html5tutorial.net/examples/canvas-examples.html</link>
		<comments>http://html5tutorial.net/examples/canvas-examples.html#comments</comments>
		<pubDate>Fri, 11 Sep 2009 13:17:11 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[HTML5 Canvas example]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=179</guid>
		<description><![CDATA[One of the most talked about features of the upcoming HTML5 code is the &#60;canvas&#62; element / tag, some of you may be aware that the &#60;canvas&#62; was first developed by Apple for use in their Mac OS X Dashboard and also implemented at a later date by the Safari browser, Most Gecko based browsers [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most talked about features of the upcoming <a href="http://www.discussionoftheday.com/webmaster/">HTML5</a> code is the &lt;canvas&gt; element / tag, some of you may be aware that the &lt;canvas&gt; was first developed by Apple for use in their Mac OS X Dashboard and also implemented at a later date by the Safari browser, Most Gecko based browsers such as FireFox have current support for the &lt;canvas&gt; tag.</p>
<p>We will keep this example very basic and over time we will delve in a little deeper, our example below should give you a rough idea of what is possible with this new inclusion. See the example here: <a title="html5 canvas test" href="http://html5tutorial.net/examples/html5-canvas-test.html" target="_blank">HTML5 Canvas Test</a></p>
<div id="stb-container" class="stb-container"><div class='stb-alert-caption_box stb_caption' >HTML5 Canvas Test Code:</div><div class='stb-alert-body_box stb_body' ></p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Canvas tutorial&lt;/title&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
function draw(){<br />
var canvas = document.getElementById(&#8216;tutorial&#8217;);<br />
if (canvas.getContext){<br />
var ctx = canvas.getContext(&#8217;2d&#8217;);<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;style type=&#8221;text/css&#8221;&gt;<br />
canvas { border: 2px solid red; }<br />
&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body onLoad=&#8221;draw();&#8221;&gt;<br />
&lt;canvas id=&#8221;tutorial&#8221; width=&#8221;175&#8243; height=&#8221;175&#8243;&gt;&lt;/canvas&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p></div></div>
<p>As you can see the &#8220;Draw&#8221; function in this script tells the browser what to render, as our example shows above we have told the browser to &#8220;Draw&#8221; once the page has finished loading this is controlled by the &#8220;onLoad&#8221; function, there are many variables you can use for this.</p>
<p>Here is another quick example that tells the browser to draw 2 rectangles which overlay each other, <a title="html5 canvas test #2" href="http://html5tutorial.net/examples/html5-canvas-test-2.html" target="_blank">HTML5 Canvas Test #2</a></p>
<div id="stb-container" class="stb-container"><div class='stb-alert-caption_box stb_caption' >HTML5 Canvas Test #2 Code:</div><div class='stb-alert-body_box stb_body' ></p>
<p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;application/x-javascript&#8221;&gt;<br />
function draw() {<br />
var canvas = document.getElementById(&#8220;canvas&#8221;);<br />
if (canvas.getContext) {<br />
var ctx = canvas.getContext(&#8220;2d&#8221;);</p>
<p>ctx.fillStyle = &#8220;rgb(40,0,0)&#8221;;<br />
ctx.fillRect (20, 20, 65, 60);</p>
<p>ctx.fillStyle = &#8220;rgba(0, 0, 160, 0.5)&#8221;;<br />
ctx.fillRect (40, 40, 65, 60);<br />
}<br />
}<br />
&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body onLoad=&#8221;draw();&#8221;&gt;<br />
&lt;canvas id=&#8221;canvas&#8221; width=&#8221;150&#8243; height=&#8221;150&#8243;&gt;&lt;/canvas&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p></div></div>
<p>While it may seem very simple the new JavaScript &amp; &lt;canvas&gt; element are going to play a huge part in the way we develop websites and applications in the future, the options are endless. As mentioned on our site several other times, over the coming weeks and months we will take a look into much more advanced <a title="html5 Tutorials" href="http://html5tutorial.net/" target="_self">HTML5 tutorials</a>. Please feel free to copy the above code and have a play around with it on your own computer.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/examples/canvas-examples.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dreamweaver compatibility</title>
		<link>http://html5tutorial.net/examples/dreamweaver-compatibility.html</link>
		<comments>http://html5tutorial.net/examples/dreamweaver-compatibility.html#comments</comments>
		<pubDate>Fri, 11 Sep 2009 09:41:44 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[Dreamweaver compatibility]]></category>
		<category><![CDATA[HTML5 standards]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=174</guid>
		<description><![CDATA[Today we would like to discuss the Dreamweaver compatibility worries. Myself and many others have been querying whether or not Adobe Dreamweaver would need a core update to be able to process and or read &#38; write in HTML5 standards, some very helpful users of Adobe forums were kind enough to answer our questions, Dreamweaver [...]]]></description>
			<content:encoded><![CDATA[<p>Today we would like to discuss the Dreamweaver compatibility worries. Myself and many others have been querying whether or not Adobe Dreamweaver would need a core update to be able to process and or read &amp; write in HTML5 standards, some very helpful users of Adobe forums were kind enough to answer our questions, Dreamweaver will not need a core update (this could be a possibility down the track and could be released as a simple update rather than a code update) if you are wondering how to implement HTML5 into your Dreamweaver or other HTML editing application we have a simple solution.</p>
<p>Simply download the following <a title="HTML5 Dreamweaver Template" href="http://html5tutorial.net/downloads/blank-Page.dwt">Dreamweaver template file</a> (this is a blank template), then load this into your Dreamweaver templates, or your can create your own DWT(Dream-Weaver-Template) with the following code:</p>
<div id="stb-container" class="stb-container"><div class='stb-alert-caption_box stb_caption' >HTML5 template:</div><div class='stb-alert-body_box stb_body' ></p>
<p>&lt;!DOCTYPE HTML&gt;<br />
&lt;HTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;TITLE&gt;HTML5 Template&lt;/TITLE&gt;<br />
&lt;/HEAD&gt;<br />
&lt;BODY&gt;</p>
<p>&lt;!&#8211; Add your content here&#8211;&gt;</p>
<p>&lt;/BODY&gt;<br />
&lt;/HTML&gt;</p>
<p></div></div>
<div id="stb-container" class="stb-container"><div class='stb-alert-caption_box stb_caption' >XHTML5 template:</div><div class='stb-alert-body_box stb_body' ></p>
<p>&lt;!DOCTYPE XHTML&gt;<br />
&lt;XHTML&gt;<br />
&lt;HEAD&gt;<br />
&lt;TITLE&gt;XHTML5 Template&lt;/TITLE&gt;<br />
&lt;/HEAD&gt;<br />
&lt;BODY&gt;</p>
<p>&lt;!&#8211; Add your content here&#8211;&gt;</p>
<p>&lt;/BODY&gt;<br />
&lt;/XHTML&gt;</p>
<p></div></div>
<p>As HTML5 is still a work in progress we can not 100% guarantee the above coding, you will hear about this debate again in the future but as for the now, please use the templates above until further notice.</p>
<p>XHTML is fast becoming the popular choice and we are sure Whatwg will clarify this shortly, most users are leaning towards XHTML over HTML, so you might be better of starting with the previously stated XHTML.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/examples/dreamweaver-compatibility.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic template</title>
		<link>http://html5tutorial.net/examples/basic-template.html</link>
		<comments>http://html5tutorial.net/examples/basic-template.html#comments</comments>
		<pubDate>Fri, 11 Sep 2009 08:13:36 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[!DOCTYPE HTML]]></category>
		<category><![CDATA[Basic template]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=168</guid>
		<description><![CDATA[So you want to create your first HTML 5 valid website, as we are getting many requests as to how to achieve this below is the correct format for creating a HTML5 template / HTML5 page: As you can see there is not much to this, this is however a very basic page layout, if [...]]]></description>
			<content:encoded><![CDATA[<p>So you want to create your first HTML 5 valid website, as we are getting many requests as to how to achieve this below is the correct format for creating a HTML5 template / HTML5 page:</p>
<div id="stb-container" class="stb-container"><div class='stb-alert-caption_box stb_caption' >Basic template:</div><div class='stb-alert-body_box stb_body' ><br />
<pre><pre><br />
<br />
&lt;!DOCTYPE html&gt;<br />
<br />
&lt;html&gt;<br />
<br />
&lt;head&gt;<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;New HTML5 page&lt;/title&gt;<br />
<br />
&lt;/head&gt;<br />
<br />
&lt;body&gt;<br />
<br />
&lt;!-- Add your content here--&gt;<br />
<br />
&lt;/body&gt;<br />
<br />
&lt;/html&gt;<br />
<br />
</pre></pre></p>
<p></div></div>
<p>As you can see there is not much to this, this is however a very basic page layout, if you wish to get more creative with this then please refer to our <a title="HTML5 reference" href="http://html5tutorial.net/html-5-reference/html-5-reference.html#more-35">HTML 5 reference page</a> for further information or download our free <a title="HTML5 Template" href="http://html5tutorial.net/downloads/free-html-5-template.html" target="_self">HTML5 valid template</a>. We are currently working on more tutorials which should be ready in the coming weeks, keep an eye on our site or subscribe to our Rss feeds to keep up to date.</p>
<p>This should keep you busy for now, yes the above is very simple, but it is also a great starting point to learn from.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/examples/basic-template.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>HTML 5 Canvas cheat sheet</title>
		<link>http://html5tutorial.net/examples/html-5-canvas-cheat-sheet.html</link>
		<comments>http://html5tutorial.net/examples/html-5-canvas-cheat-sheet.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 07:53:05 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>
		<category><![CDATA[HTML 5 Canvas cheat sheet]]></category>
		<category><![CDATA[HTML5 canvas]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=164</guid>
		<description><![CDATA[Today we have a HTML5 Canvas cheat sheet for you to download or use as a reference, pictured below is a resized version, if you wish to download or view the full sized version please CLICK HERE.]]></description>
			<content:encoded><![CDATA[<p>Today we have a HTML5 Canvas cheat sheet for you to download or use as a reference, pictured below is a resized version, if you wish to download or view the full sized version please <a title="HTML5 canvas cheat sheet" href="http://html5tutorial.net/downloads/canvas-cheat-sheet/HTML-5-Canvas-Cheat-Sheet.png" target="_blank">CLICK HERE</a>.</p>
<div id="attachment_165" class="wp-caption aligncenter" style="width: 510px"><img class="size-full wp-image-165" title="HTML-5-Canvas-Cheat-Sheet-small" src="http://html5tutorial.net/wp-content/uploads/2009/09/HTML-5-Canvas-Cheat-Sheet-small.png" alt="HTML5 Canvas Cheat Sheet" width="500" height="370" /><p class="wp-caption-text">HTML5 Canvas Cheat Sheet</p></div>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/examples/html-5-canvas-cheat-sheet.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powerful forms with HTML5</title>
		<link>http://html5tutorial.net/examples/powerful-forms-with-html5.html</link>
		<comments>http://html5tutorial.net/examples/powerful-forms-with-html5.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 18:52:39 +0000</pubDate>
		<dc:creator>editor</dc:creator>
				<category><![CDATA[Examples]]></category>

		<guid isPermaLink="false">http://html5tutorial.net/?p=105</guid>
		<description><![CDATA[Creating forms with HTML5 is a simple process, anyone who has designed a website before would know how easy forms are, with HTML5 forms will be more powerful than ever before yet still simple to put together. Also note: you will need the Opera browser (version 9+) to view this example correctly. Basic HTML 5 [...]]]></description>
			<content:encoded><![CDATA[<p>Creating forms with HTML5 is a simple process, anyone who has designed a website before would know how easy forms are, with HTML5 forms will be more powerful than ever before yet still simple to put together. <strong>Also note</strong>: you will need the Opera browser (version 9+) to <a href="http://html5tutorial.net/examples/html5-forms.html">view this example</a> correctly. <span id="more-105"></span></p>
<p><strong>Basic HTML 5 layout code:</strong></p>
<p><pre><code><br />
&lt;!DOCTYPE HTML&gt;<br />
&lt;html&gt;<br />
&lt;body&gt;<br />
&lt;form action=&quot;/examples/powerful-forms-with-html5.html&quot;&gt;<br />
First Name: &lt;input type=&quot;text&quot; name=&quot;fname&quot; value=&quot;&quot; /&gt;&lt;br /&gt;<br />
Last Name: &lt;input type=&quot;text&quot; name=&quot;lname&quot; value=&quot;&quot; /&gt;&lt;br /&gt;<br />
&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;<br />
&lt;/form&gt;<br />
&lt;p&gt;Click the submit button and you will return to our site.&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
</code></pre></p>
<p>Please copy and paste the HTML5 form code above and have a play around with it so you get used to some of the new attributes (<a href="http://html5tutorial.net/html-5-attributes/html-5-attributes.html">HTML5 Attributes</a>), next week we will be adding a step by step HTML 5 form guide.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://html5tutorial.net/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://html5tutorial.net/examples/powerful-forms-with-html5.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
