Taking a Dive into HTML5 – Web Storage

HTML5 is getting a lot of attention these days – especially when it comes to video. This tutorial is going to cover a feature added to HTML5 that I don’t think is getting enough attention – web storage.

Prior to web storage, most websites used cookies to store information on the client’s computer. Cookies, for the most part, work great for simple storage. They do, however, have one major drawback. If the user is visiting your site on two separate windows or tabs, information stored in cookies will be shared between them. To handle this case, the web storage in HTML5 has been split into two pieces: localStorage and sessionStorage. The first one works like cookies, saving information for an entire site (origin). The second one, sessionStorage, will store information for each origin but keep it isolated between windows or tabs.

Before we get started, I should note that not every browser supports web storage. Wikipedia is maintaining a pretty good list of HTML5 browser compatibility that should probably be consulted before using storage in a production environment.

Reading and Writing Values

Both mechanism use the same object as defined in the web storage spec, Storage. Let’s take a look at this interface.

interface Storage {
  readonly attribute unsigned long length;
  getter DOMString key(in unsigned long index);
  getter any getItem(in DOMString key);
  setter creator void setItem(in DOMString key, in any data);
  deleter void removeItem(in DOMString key);
  void clear();
};

Hats off the creators of this, as I don’t think there could have been a simpler interface for storing values. At its core, this is basically a dictionary mapping string keys to object values. For the most part, pretty much anything can be stored in here – as long as it can be cloned using the structured clone algorithm

Let’s take a look at how do use this, first using localStorage.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
      <title></title>
      <script type="text/javascript">
         function load()
         {
          var value = localStorage.getItem("myKey");
         
          if(!value)
          {
            alert("No item found, adding to localStorage");
            localStorage.setItem("myKey", "myValue");
          }
          else
          {
            alert("Item found: " + value);
          }
         }
      </script>
   </head>
   <body onload="load()">
       
   </body>
</html>

In this example, if the value hasn’t been stored yet, you’ll receive this alert:

No item alert

The next time the page is loaded, you’ll now receive this alert:

Item found alert

As you can see, using localStorage is incredibly easy. This value will now be stored indefinitely on the client’s computer ready for me to retrieve whenever they visit my website again.

Using sessionStorage is just as easy. All we have to do is replace the object we’re using and we’re done.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
      <title></title>
      <script type="text/javascript">
         function load()
         {
          var value = sessionStorage.getItem("myKey");
         
          if(!value)
          {
            alert("No item found, adding to sessionStorage");
            sessionStorage.setItem("myKey", "myValue");
          }
          else
          {
            alert("Item found: " + value);
          }
         }
      </script>
   </head>
   <body onload="load()">
       
   </body>
</html>

The code is nearly identical to the previous code, however this time, if you open the site in two different tabs, you’ll receive the “No item found” message for each tab. In the previous example, the value existed for every new tab or window created.

One thing to remember when dealing with HTML5 web storage is that it does not cross browsers. The spec does not outline where or how a browser must store the data. Therefore if the user visits your site in one browser one day, then in a different browser the next, you will not be able to see values that were stored by the other browser.

Listening for Changes

The HTML5 spec outlines an event that client’s can attach to in order to receive updates whenever a storage (local or session) changes. At this point in time, however, I wasn’t able to get it working in Chrome (6.0.401.1 dev). I was, however, able to get the following code working in Opera.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
   <head>
      <title></title>
      <script type="text/javascript">
         function load()
         {
         localStorage.clear();
          var value = localStorage.setItem("myKey", "myNewValue");
          alert(localStorage.getItem("myKey"));
         }
         
         function storageChanged(e)
         {
          alert("Storage changed.");
         }
      </script>
   </head>
   <body onstorage="storageChanged()" onload="load()" >
       
   </body>
</html>

In Opera, the storageChanged event will fire twice – once for when the localStorage is cleared, and again when the value is set.

Although we’re moving in the right direction, HTML5 still has a ways to go before it’s fully adopted. Web Storage has a great amount of potential in the future of web apps and I can wait to see what developers are able to do with it.

Internet Marketing For Property Website

Internet Marketing for Property Website – Looking for Long Term SEO Partners

Huge earning potential, for the right providers who are willing to prove their ability. I have posted a couple of jobs recently which i have cancelled now related to SEO for my site www.home-rescue.co.uk
The problem i have had with the last two projects that i posted up, is that i understand the basics of SEO however i am not sure of the strategy to take forward and the strategy that will best serve me right. Some people say backlinks, some people say articles, some people say bookmarks, some people say social media.
So the last two projects have confused me very much and made me decide to cancel the project since i am not sure which direction to go.

The brief for my project is very simple. I want targetted traffic to my site, which convert into leads. The more traffic you get the more money you get.
I am now looking for people to prove to me that they have what it takes to achive the results i desire and therefore propose a Pay on Results SEO campaign. You have to show me that what you are doing is working and getting traffic to my site. The more you perform the more money you will get. These can be tracked via analytics or any other analytics software and we can both see the improvements the SEO is having.

I am willing to pay a small base line figure per month, and as thngs improve the figure will be increased. I am also happy to pay a commision for each lead that comes as a result of SEO Marketing. A potential lead is worth thousands to me…so the potential for earnings is huge.

These are the tasks that need doing:
1. Keyword Research – The keywords are very competitive, so some research needs to be done into that to see which keywords are best to target.
2. Competitor Analysis – asses the competitors and find out how they are ranking for SEO
3. Page analysis & Content Review – make sure pages have the right content on them
4. On Page Optimisation
5. Link Building – Get listed on directories and create quality inbound links from relevant sites with high PR
6. Ranking & Traffic Analysis – Analysing the traffic coming through and ranking appropriately.
7. Continuos improvement – Making sure that all the time the site is being improved in terms of SEO
8. Viral Marketing & Social Networking – devise a plan to create a buzz & reach the target audience through social media (facebook, youtube, twitter)
9. Article Marketing – Creating and submitting articles to the main article sites to create good content on site. Also submitting articles to my site for continual site growth.
10. Google Local Listing – optimising Google Local Listing for my site in various locations.

So with those things in mind please put forward your proposals. Remember the more traffic you get the more money you get. I want you to prove to me that you can do what you say. Potential to earn lots of money by getting paid for the leads that come through as a result of the increased traffic.

I look forward to your proposals.

Flash Player Needed And Basic Html Editing

I need 3 flash players for the site similar to the flash players at simplynoise.com

I will have a

1. white noise player

2. brown noise player

3. a player that will play a looping thunderstorm mp3

I will provide the MP3 files for the players I will need you to seamlessly loop the files so they play without interruption

On the right hand side of the page where the text box and the picture is I need an include file where I can add a vertical banner. I need a fake banner added in that location until i add my own

I would like it where I can add and delete files to each player if i need to

I have attached the files to the site. I also need the website to look the same as it does on the computer. I uploaded the files to my server and it looks different for some reason

Internet Marketing For Property Website

Internet Marketing for Property Website – Looking for Long Term SEO Partners

Huge earning potential, for the right providers who are willing to prove their ability. I have posted a couple of jobs recently which i have cancelled now related to SEO for my site www.home-rescue.co.uk
The problem i have had with the last two projects that i posted up, is that i understand the basics of SEO however i am not sure of the strategy to take forward and the strategy that will best serve me right. Some people say backlinks, some people say articles, some people say bookmarks, some people say social media.
So the last two projects have confused me very much and made me decide to cancel the project since i am not sure which direction to go.

The brief for my project is very simple. I want targetted traffic to my site, which convert into leads. The more traffic you get the more money you get.
I am now looking for people to prove to me that they have what it takes to achive the results i desire and therefore propose a Pay on Results SEO campaign. You have to show me that what you are doing is working and getting traffic to my site. The more you perform the more money you will get. These can be tracked via analytics or any other analytics software and we can both see the improvements the SEO is having.

I am willing to pay a small base line figure per month, and as thngs improve the figure will be increased. I am also happy to pay a commision for each lead that comes as a result of SEO Marketing. A potential lead is worth thousands to me…so the potential for earnings is huge.

These are the tasks that need doing:
1. Keyword Research – The keywords are very competitive, so some research needs to be done into that to see which keywords are best to target.
2. Competitor Analysis – asses the competitors and find out how they are ranking for SEO
3. Page analysis & Content Review – make sure pages have the right content on them
4. On Page Optimisation
5. Link Building – Get listed on directories and create quality inbound links from relevant sites with high PR
6. Ranking & Traffic Analysis – Analysing the traffic coming through and ranking appropriately.
7. Continuos improvement – Making sure that all the time the site is being improved in terms of SEO
8. Viral Marketing & Social Networking – devise a plan to create a buzz & reach the target audience through social media (facebook, youtube, twitter)
9. Article Marketing – Creating and submitting articles to the main article sites to create good content on site. Also submitting articles to my site for continual site growth.
10. Google Local Listing – optimising Google Local Listing for my site in various locations.

So with those things in mind please put forward your proposals. Remember the more traffic you get the more money you get. I want you to prove to me that you can do what you say. Potential to earn lots of money by getting paid for the leads that come through as a result of the increased traffic.

I look forward to your proposals.

Aioo Instructional Video

hello. i am in need of someone to create a video for me. i have created all of the parts of the video, i just need someone to put it together for me in a video file that would be the right format and size to be able to post it to a wordpress site.

there are five videos total that need to be made into one file. two of the videos are screen capture videos and were created with Cam Studio – a free software. both of them contain audio. they are saved as .avi files.

the other three are actually power point slide shows, with attached audio. i’ll be happy to answer any questions. basically, i just need someone to take the video files i’ve already made, convert them to whatever size and format they need to be, then put into one video.

Aioo Instructional Video

hello. i am in need of someone to create a video for me. i have created all of the parts of the video, i just need someone to put it together for me in a video file that would be the right format and size to be able to post it to a wordpress site.

there are five videos total that need to be made into one file. two of the videos are screen capture videos and were created with Cam Studio – a free software. both of them contain audio. they are saved as .avi files.

the other three are actually power point slide shows, with attached audio. i’ll be happy to answer any questions. basically, i just need someone to take the video files i’ve already made, convert them to whatever size and format they need to be, then put into one video.