title: Uncaught reference error: Firebase is not defined when using with phonegap
body: <p>I have the following html code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;Current Tour&lt;/title&gt;
      &lt;!-- cordova --&gt;
          &lt;script type="text/javascript" src="../cordova.js"&gt;&lt;/script&gt;
      &lt;!-- jquery --&gt;
          &lt;link rel="stylesheet" href="../jquery/jquery.mobile-1.3.2.min.css"&gt;
          &lt;script type="text/javascript" src="../jquery/jquery-1.8.3.min.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="../jquery/jquery.mobile-1.3.2.min.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;!-- firebase database --&gt;
          &lt;script type='text/javascript' src='https://cdn.firebase.com/v0/firebase.js'&gt;&lt;/script&gt;
      &lt;!-- current_tour.js --&gt;
          &lt;script src="../js/current_tour.js"&gt;&lt;/script&gt;
  
      &lt;h1&gt;Current Tour&lt;/h1&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and following javascript</p>
  
  <pre><code>var trip_id;
  
  function onDeviceReady() {
      alert('device ready');
      var fb_id_ref = new Firebase('https://trip- chronicle.firebaseio.com/'+window.localStorage.getItem("fb_id"));
      console.log("**DEBUG**: Connected to firebase");
  
      var facebook_id = fb_id_ref.name();
  
      fb_id_ref.on('child_added', function(childSnapShot){
      console.log("**DEBUG**: fireBaseRef.on()");
      trip_id = childSnapShot.ref();
      alert(trip_id);
      });
  }    
  
  document.addEventListener("deviceready", onDeviceReady, false);
  </code></pre>
  
  <p>If I create some button and call <em>onDeviceReady</em> with button <em>onclick</em> event, it works fine. But, if I try to call <em>onDeviceReady</em> with event listener  <em>deviceready</em> I get this error: <em>Uncaught reference error: Firebase is not defined.</em></p>