title: PhoneGap Ready and Javascript code
body: <p>I am quite confused with when to call my JS code. I have the following </p>
  
  <pre><code>Zepto(function($) {
    document.addEventListener("deviceready", onDeviceReady, false);
  });
  
  function onDeviceReady() {
    initalizeData();
    FastClick.attach(document.body);
    startSnapper();
    $('input[name=topcoat]').change(function(){ schoolValueChanged() });
  }
  </code></pre>
  
  <p>When the device is ready, <code>deviceready</code> is triggered. The function <code>onDeviceReady</code> sets up my Javascript.</p>
  
  <p>Is that the right way of doing it?</p>