title: IE 11 Unable to get property 'length' of undefined or null reference
body: <p>I am getting an error in internet explorer 11</p>
  
  <blockquote>
    <p>"Unable to get property 'length' of undefined or null reference" on
    line</p>
  </blockquote>
  
  <pre><code>if (window.localStorage.length !== 0)
  </code></pre>
  
  <p>it works fine on chrome and Firefox, not sure whats causing it</p>
  
  <pre><code>&lt;script&gt;
      function initialize() {
          // test to see if brouser supports storeage api
          var bSupportsLocal = (('localStorage' in window) &amp;&amp; window.localStorage !== null );
  
          if (!bSupportsLocal) {
              document.getElementById('infoform').innerHTML = "&lt;p&gt; Sorry, This browser does not suport local storage. &lt;/p&gt;";
              return;
          }
  
          if (window.localStorage.length !== 0) {
          document.getElementById('firstName').value = window.localStorage.getItem('firstName');
          $.mobile.navigate("#benefits-facts");
          }
      }
  
      function storeLocalContent(fName) {
          window.localStorage.setItem('firstName', fName);
  
          }
  
          function clearLocalContent(strToStore) {
              window.localStorage.clear();
  
              }
  
      window.onload = initialize;
      &lt;/script&gt; 
  </code></pre>