title: LocalStorage in Phonegap across different pages
body: <p>I'm trying to use a simple string stored in the localStorage functionality built into phonegap as a simple setting to deicide witch set of data to fetch from a server. In the index.html I've been able to save a string from a <code>&lt;select&gt;</code> menu and display it in the header. Using this javascript code:</p>
  
  <pre><code>            &lt;script type="text/javascript" charset="utf-8"&gt;
  
              window.onload = function() {
                  document.getElementById("BtnStore").addEventListener("click", storeData, false);
                  $("#headertitle").append(loadData()).headertitle("refresh");
              }
  
              function storeData() {
                  var e = document.getElementById("klass");
                  var klass = e.options[e.selectedIndex].value;
                  localStorage.setItem("klass", klass);
  
                  window.location.href = "index.html";
              }
  
  
  
              function loadData() {
                  var getKlass = localStorage.getItem("klass");
                  return getKlass;
              }
  
  
              &lt;/script&gt;
  </code></pre>
  
  <p>This appends the stored value in an <code>&lt;h1&gt;</code> element.</p>
  
  <p>But when I from a different html page try to reference the same key from the localstore, nothing is being displayed. Here is that code:</p>
  
  <pre><code>            &lt;script type="text/javascript" charset="utf-8"&gt;
  
              document.addEventListener("deviceready", onDeviceReady, false);
              function onDeviceReady() {
                  $("#hejsan").append(loadData()).hejsan("refresh");
              };
  
  
              function loadData() {
                  var getKlass = localStorage.getItem("klass");
                  return getKlass;
              }
  
  
              &lt;/script&gt;
  </code></pre>
  
  <p>This is also just as a test, appending the string to a <code>&lt;p&gt;</code> element. For some reason nothing is happening, someone knows why?</p>
  
  <p>Thanks</p>