We normally need to check for browser support when we want to use a feature, such as navigator.GeoLocation object.
But exactly where and how do they exist? A physical dll file or completely saved in memory when the browsrr is running? Thanks
Fady Sadek
1,1601 gold badge13 silver badges23 bronze badges
asked Feb 2, 2017 at 19:30
user6338533
1 Answer 1
You can use following packages
Here : https://modernizr.com/docs/#what-is-feature-detection
But want with GeoLocation use this type of code
// Try HTML5 geolocation
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var pos = new google.maps.LatLng(position.coords.latitude,
position.coords.longitude);
var infowindow = new google.maps.InfoWindow({
map: map,
position: pos,
content: 'Location found using HTML5.'
});
map.setCenter(pos);
}, function() {
handleNoGeolocation(true);
});
} else {
// Browser doesn't support Geolocation
handleNoGeolocation(false);
}
Sign up to request clarification or add additional context in comments.
Comments
lang-html