相关疑难解决方法(0)

Http网站未检测到Chrome中的位置 - 问题

我们今天注意到了根据用户位置自动检测邮政编码的问题.它在其他浏览器(边缘,IE,Firefox)中运行良好我们必须将站点配置为https,然后才能正常工作

示例:https://www.whatismyzip.com/适用于http://www.mapdevelopers.com/what-is-my-zip-code.php无法正常工作的地方.

  <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdGQKI4sEj5TZAjNCds422V_ZHevD45Fo"></script>
 <%--   <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>--%>

 <%--     <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places"></script>
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>--%>
    <script type="text/javascript">


        function ShowMessages() {

            debugger;
            if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(success);
            } else {
                alert("Geo Location is not supported on your current browser!");
            }
            function success(position) {
                debugger;
                var lat = position.coords.latitude;
                var lng = position.coords.longitude;
                var latlng = new google.maps.LatLng(lat, lng);
                var geocoder = geocoder = new google.maps.Geocoder();
                geocoder.geocode({ 'latLng': latlng }, function (results, status) {
                    if (status …
Run Code Online (Sandbox Code Playgroud)

javascript google-maps google-chrome http geolocation

9
推荐指数
3
解决办法
1万
查看次数

Firefox 中是否存在与 Chrome 标志“不安全来源视为安全”等效的内容?

Insecure origins treated as secure在 Chrome 中使用“”标志用于开发目的,并且我添加了一些网站,例如http://myWebsite:port. 它在 Chrome 中运行得很好。现在我需要在 Firefox 中使用相同的功能,但找不到它。在 Firefox 中可以这样做吗?

firefox google-chrome secure-context

8
推荐指数
1
解决办法
1万
查看次数