title: phonegap - device is not defined
body: <p>When I launch the app, it will open <code>index.html</code> which run this code :  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          document.addEventListener('deviceready', app.onDeviceReady, false);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>in <code>app.js</code>  </p>
  
  <pre><code>var app = {
      onDeviceReady: function() {
          alert(device.model);
          window.location.replace('pages/home.html');
      },
  };
  </code></pre>
  
  <p>it will alert <code>device.model</code> and redirect to <code>pages/home.html</code>.  </p>
  
  <p>in <code>pages/home.html</code>,  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          alert(device.model);
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>on the first alert i get the device model correctly, but after redirecting to <code>pages/home.html</code>, I get the error <code>Uncaught ReferenceError: device is not defined</code></p>