title: Reading and writing from localStorage?
body: <p>I just started to study Phonegap + jQuery Mobile and HTML5,, so don't loose your nerve with my idiocy!</p>
  
  <p>Could somebody tell me why this is not working? When I am using a variable from localStorage, I just get an empty screen when pressing the button, but when using a variable temperature="100", it is working fine. Android 4.1.</p>
  
  <pre><code>&lt;script type="text/javascript" charset="utf-8"&gt;
  document.addEventListener("deviceready", onDeviceReady, false);
  function onDeviceReady() {
    window.localStorage.setItem("temperature", "100");
    var temperature = window.localStorage.getItem("temperature");
  }
  &lt;/script&gt;
  &lt;div data-role="content"&gt;
    &lt;p&gt;Working or not?&lt;/p&gt;
    &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
    &lt;p id="testi"&gt;&lt;/p&gt;
  &lt;script type="text/javascript"&gt;
    function myFunction() {
      //var temperature = "100";----&gt; This is working!
      document.getElementById("testi").innerHTML = temperature;
    }
   &lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Another question: How to handle variables between pages in Windows Phone? They are not supporting localStorage, so is there another way to handle this if you haven't got db-connection?</p>
  
  <p>Thanks!</p>
  
  <p>Sami</p>