<?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>Cloud standards &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/cloud-standards/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Storing JavaScript objects in html5 localStorage</title>
		<link>/2010/02/24/storing-javascript-objects-in-html5-localstorage/</link>
		<comments>/2010/02/24/storing-javascript-objects-in-html5-localstorage/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 15:39:31 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Cloud standards]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[HTML 5]]></category>
		<category><![CDATA[JavaScript programming language]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Markup languages]]></category>
		<category><![CDATA[Mozilla Firefox]]></category>
		<category><![CDATA[Mozilla Firefox 3.5]]></category>
		<category><![CDATA[Technology/Internet]]></category>

		<guid isPermaLink="false">/?p=1138</guid>
		<description><![CDATA[There is a rising new age of HTML5, which comes with very nice features as video tag and localStorage. What localStorage is? In fact we have been waiting for long time to have something that give us the power of storing more and more on the client side. That&#8217;s because the net is becoming larger &#8230; <a href="/2010/02/24/storing-javascript-objects-in-html5-localstorage/" class="more-link">Continue reading <span class="screen-reader-text">Storing JavaScript objects in html5 localStorage</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/02/25/jquery-localstorage-plugin/" rel="bookmark" title="jQuery localStorage plugin">jQuery localStorage plugin </a></li>
<li><a href="/2010/02/26/jquery-localstorage-plugin-alpha/" rel="bookmark" title="jQuery localStorage plugin (alpha)">jQuery localStorage plugin (alpha) </a></li>
<li><a href="/2010/08/11/quick-look-at-javascript-objects/" rel="bookmark" title="Quick Look at JavaScript Objects">Quick Look at JavaScript Objects </a></li>
<li><a href="/2010/04/13/secure-localstorage-now-thats-a-good-question/" rel="bookmark" title="Secure localStorage? Now that&#8217;s a good question!">Secure localStorage? Now that&#8217;s a good question! </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>There is a rising new age of HTML5, which comes with very nice features as video tag and localStorage. What localStorage is? In fact we have been waiting for long time to have something that give us the power of storing more and more on the client side. That&#8217;s because the net is becoming larger and therefore heavy.</p>
<p>Imagine if you have the possibility to store large JSON returned from an AJAX call on the client. That&#8217;s now reality with the localStorage object in HTML5 and it can be accessed with something like this code:</p>
<pre lang="javascript">localStorage.setItem(key, value);
alert(localStorage.getItem(key));
</pre>
<h2>Can we store entire objects?</h2>
<p>Yes there is a way extending a bit the logic of the code above. The localStorage in fact stores only strings, but what about arrays and objects. You can additionally use JSON global objects and its two methods &#8211; stringify and parse:</p>
<pre lang="javascript">var a = JSON.stringify({name:'obj'});
alert(JSON.parse(a));
</pre>
<h2>Do browsers support all that?</h2>
<p>Of course &#8230; not! localStorage is supported by Firefox 3.5+, Chrome 2+, Safari 4+ and MSIE 8+. The solution is not to rely on browser version, but to check for object existence, and than to combine both techniques:</p>
<pre lang="javascript">localStorage.setItem('a', JSON.stringify({ name : 'obj' }));
alert(JSON.parse(localStorage.getItem('a')));
</pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/02/25/jquery-localstorage-plugin/" rel="bookmark" title="jQuery localStorage plugin">jQuery localStorage plugin </a></li>
<li><a href="/2010/02/26/jquery-localstorage-plugin-alpha/" rel="bookmark" title="jQuery localStorage plugin (alpha)">jQuery localStorage plugin (alpha) </a></li>
<li><a href="/2010/08/11/quick-look-at-javascript-objects/" rel="bookmark" title="Quick Look at JavaScript Objects">Quick Look at JavaScript Objects </a></li>
<li><a href="/2010/04/13/secure-localstorage-now-thats-a-good-question/" rel="bookmark" title="Secure localStorage? Now that&#8217;s a good question!">Secure localStorage? Now that&#8217;s a good question! </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/02/24/storing-javascript-objects-in-html5-localstorage/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
