html5 - http是否不支持h5 Geolocatio
迷茫
迷茫 2017-04-17 13:55:30
0
2
896

用本机ip访问无法获取坐标,用localhost访问倒是可以,有人遇到过吗

换成https也可以,但是就是http的不行

报错:
getCurrentPosition() and watchPosition() no longer work on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
伊谢尔伦

Starting from chrome 50, http access is no longer supported. You need to switch to https
The server localhost on your local machine is considered safe, similar to https, so it can be used to run the local server For testing
If you must use it, you can set it up like this

1、修改安全策略   --unsafely-treat-insecure-origin-as-secure="http://example.com" flag (假设"example.com" 就是你要跑的域名),
--user-data-dir=C:\testprofile
巴扎黑

This api cannot be used locally.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template