Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Error codes returned in the PositionError object HTML5 Geolocation
The following table describes the possible error codes returned in the PositionError object:
Code | Constant | Description |
|---|---|---|
| 0 | UNKNOWN_ERROR | The method failed to retrieve the location of the device due to an unknown error. |
| 1 | PERMISSION_DENIED | The method failed to retrieve the location of the device because the application does not have permission to use the Location Service. |
| 2 | POSITION_UNAVAILABLE | The location of the device could not be determined. |
| 3 | TIMEOUT | The method was unable to retrieve the location information within the specified maximum timeout interval. |
Following is a sample code, which makes use of the PositionError object. Here errorHandler method is a callback method:
function errorHandler( err ) { if (err.code == 1) { // access is denied } ... }Advertisements