javascript - geolocation not working in chrome -
i have used following script in mozilla , chrome browser. in mozilla, asking whether share location. in chrome not displaying anything.
<script> var x = document.getelementbyid("demo"); function getlocation() { if (navigator.geolocation) { navigator.geolocation.getcurrentposition(showposition); } else { x.innerhtml = "geolocation not supported browser."; } } function showposition(position) { x.innerhtml = "latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude; } </script>
do use chrome50 ? removed geolocation support non https sites.
https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only
Comments
Post a Comment