title: how to check whether localstorage is available?
body: <p>W3Schools recommends (<a href="http://www.w3schools.com/html/html5_webstorage.asp" rel="nofollow">http://www.w3schools.com/html/html5_webstorage.asp</a>)</p>
  
  <pre><code>if(typeof(Storage) !== "undefined") {
      // Code for localStorage/sessionStorage.
  } else {
      // Sorry! No Web Storage support..
  }
  </code></pre>
  
  <p>to check whether a local storage is available in the browser.</p>
  
  <p>I use the following</p>
  
  <pre><code>var l=localStorage!==null?localStorage:0;
  if(l) { /*code for locale storage*/}
  </code></pre>
  
  <p>and was wondering whether this is sufficient and reliable on all browsers?</p>
  
  <p>Thx I really appreciate your help!</p>