navigator.geolocation.getCurrentPosition sometimes works sometimes doesn't

前端 未结 25 1897
伪装坚强ぢ
伪装坚强ぢ 2020-11-22 13:33

So I have a pretty simple bit of JS using the navigator.geolocation.getCurrentPosition jammy.

$(document).ready(function(){
  $(\"#business-locate, #people-l         


        
25条回答
  •  迷失自我
    2020-11-22 14:30

    Thanks to everyone for their input, this helped me.

    In addition to having to use watchPosition() instead of getCurrentPosition(), I also found that I needed to move the call from within document.ready() to the head.

提交回复
热议问题