title: Firebase: Database reference 'on' method not running callback (javascript)
body: <p>I'm tunning a query for data that may not exist . When this is the case, the callback is not run. As I understand from the docs, it should run and the snapshot.val() should be null, isn't it?</p>
  
  <p>There's a stripped down example here: <a href="http://surfmaps.eu/trombone/case.html" rel="noreferrer">http://surfmaps.eu/trombone/case.html</a></p>
  
  <p>There's a console.log inside the callback that is not executed.</p>
  
  <p>Am I missing something here?</p>
  
  <p>Bye and thanks, Luís</p>
  
  <p>Code:</p>
  
  <pre><code>function getData(id) {
      var ref=firebase.database().ref("support/"+id); 
      console.log("In getData, looking for ",ref);
  
      // get support data from firebase
      ref.on('value',function (snapshot) {
          console.log("In Value");
          console.log(snapshot);
      });
  
      console.log("end getData, looking for ",ref);
  
  }
  
  // on startup
  getData("abc");
  </code></pre>