When GPS is working
In a telephone bundle, the application will not ask you to enable gps, you must do this manually. In addition, you can provide some options, for example
var config = { enableHighAccuracy: true, timeout: 20000, maximumAge: 18000000 }
Thus, you will receive a callback with an error at the time of the timeout and when the geolocation cannot determine your position. You should just debug your problem and see how the error callback returns.
navigator.geolocation.getCurrentPosition(onSuccess, onError, config);
If it does not work
In your case, gps will not start. I can not say very much about this problem, because you only provided the html5 code. One thing I could imagine was that you are missing the cordova.js file.
For better testing and debugging, use the Ripple emulator https://chrome.google.com/webstore/detail/ripple-emulator-beta/geelfhphabnejjhdalkjhgipohgpdnoc
It emulates webapps and even has a mocker geolocation. This way you can better debug your problem because you can view the web console.
source share