What causes node to return 'navigator is not defined'

[亡魂溺海] 提交于 2019-12-10 09:37:35

问题


I am using npm package geolocation but I have also used logic such as if (navigator.geolocation) and I keep getting ReferenceError: navigator is not defined

As such?

var geo = function(){ //using Mr. Concolato's example
   function geolocation(){
      if(geo.geolocation()){//blah
        navigator.geolocation.getCurrentPosition(coords)
        console.log(coords);
      }
   }
}

来源:https://stackoverflow.com/questions/27573293/what-causes-node-to-return-navigator-is-not-defined

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!