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
Chrome and HTML5 GeoLocation denial callback
For timeout callback in Google Chrome, try the following code:
_callback = false;
function successCallback(position) {
_callback = true;
console.log('success');
}
function errorCallback(error) {
_callback = true;
alert('error');
}
setTimeout(function(){if(!_callback)console.log('ignored')}, 20000);
navigator.geolocation.getCurrentPosition(
successCallback,
errorCallback,
{timeout: 2000}
);Advertisements