Wednesday, 15 September 2010

html - Geolocation alert won't stay on screen -


I'm trying to implement the basic geographic location on my web app but the warning in Chrome will not be on the screen; It goes upstairs, but before it disappears before I can click on any option.

You are missing an error handler function. Try adding:

  var success = task (position) {// do something with status}; Var failure = function (error) {console.log ('Error occurred. Error code:' error.code); // error code may be: // 0: Unknown error // 1: deprecated with permission // 2: status unavailable (error response from location provider) // 3: timeout}; Navigator.geolocation.getCurrentPosition (success, failure);  

Also, consider adding {timout: 5000} (or any other time length) as a 3 parameter, because the location search See the documentation for the infinite document.


No comments:

Post a Comment