title: Phonegap Geolocation not working
body: <p>I'm using Phonegap.Geolocation to get the current position of the user.</p>
  
  <p>And I've found <a href="http://docs.phonegap.com/en/2.5.0/cordova_geolocation_geolocation.md.html">this example</a> in the documentation from the official website. </p>
  
  <p>However, even thought the onDevice ready is executed, neither success nor error function callback is executed. And I'm really confused by this.</p>
  
  <pre><code>document.addEventListener("deviceready", onDeviceReady, false);
  
      // Cordova is ready
      //
      function onDeviceReady() {
        alert('deviceready');
          navigator.geolocation.getCurrentPosition(onSuccess, onError);
      }
  
      // onSuccess Geolocation
      //
      function onSuccess(position) {
          var element = document.getElementById('geolocation');
          element.innerHTML = 'Latitude: '           + position.coords.latitude              + '&lt;br /&gt;' +
                              'Longitude: '          + position.coords.longitude             + '&lt;br /&gt;' +
                              'Altitude: '           + position.coords.altitude              + '&lt;br /&gt;' +
                              'Accuracy: '           + position.coords.accuracy              + '&lt;br /&gt;' +
                              'Altitude Accuracy: '  + position.coords.altitudeAccuracy      + '&lt;br /&gt;' +
                              'Heading: '            + position.coords.heading               + '&lt;br /&gt;' +
                              'Speed: '              + position.coords.speed                 + '&lt;br /&gt;' +
                              'Timestamp: '          +                                   position.timestamp          + '&lt;br /&gt;';
      }
  
      // onError Callback receives a PositionError object
      //
      function onError(error) {
          alert('code: '    + error.code    + '\n' +
                  'message: ' + error.message + '\n');
      }
  </code></pre>