javascript - HTML5 的 geolocation 警告提示?
黄舟
黄舟 2017-04-10 15:36:13
0
1
274

使用HTML5的geolocation时,chrome的控制提示如下:

getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.

这是什么意思?没看明白,求解答。

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all (1)
大家讲道理

翻译一下:getCurrentPosition() 和 watchPosition()这两个方法在不安全的环境下不建议使用,在以后的规范可能不会支持。你应该考虑appliaction的安全性,比如使用https。详细情况请看https://goo.gl/rStTGz
PS:因为获取位置信息,以及监控位置的变化这些操作都属于敏感性操作,所以browsers在执行都会非常谨慎。它需要你在安全的环境并且获取用户的同意才会执行。

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!