<legend id='Hj2gm'><style id='Hj2gm'><dir id='Hj2gm'><q id='Hj2gm'></q></dir></style></legend>

  • <small id='Hj2gm'></small><noframes id='Hj2gm'>

    1. <tfoot id='Hj2gm'></tfoot>
      1. <i id='Hj2gm'><tr id='Hj2gm'><dt id='Hj2gm'><q id='Hj2gm'><span id='Hj2gm'><b id='Hj2gm'><form id='Hj2gm'><ins id='Hj2gm'></ins><ul id='Hj2gm'></ul><sub id='Hj2gm'></sub></form><legend id='Hj2gm'></legend><bdo id='Hj2gm'><pre id='Hj2gm'><center id='Hj2gm'></center></pre></bdo></b><th id='Hj2gm'></th></span></q></dt></tr></i><div id='Hj2gm'><tfoot id='Hj2gm'></tfoot><dl id='Hj2gm'><fieldset id='Hj2gm'></fieldset></dl></div>
          <bdo id='Hj2gm'></bdo><ul id='Hj2gm'></ul>

        google.loader.clientlocation 是否仍受支持

        时间:2023-09-06
        <i id='yPSzZ'><tr id='yPSzZ'><dt id='yPSzZ'><q id='yPSzZ'><span id='yPSzZ'><b id='yPSzZ'><form id='yPSzZ'><ins id='yPSzZ'></ins><ul id='yPSzZ'></ul><sub id='yPSzZ'></sub></form><legend id='yPSzZ'></legend><bdo id='yPSzZ'><pre id='yPSzZ'><center id='yPSzZ'></center></pre></bdo></b><th id='yPSzZ'></th></span></q></dt></tr></i><div id='yPSzZ'><tfoot id='yPSzZ'></tfoot><dl id='yPSzZ'><fieldset id='yPSzZ'></fieldset></dl></div>

        <small id='yPSzZ'></small><noframes id='yPSzZ'>

          1. <tfoot id='yPSzZ'></tfoot>
              <tbody id='yPSzZ'></tbody>
            <legend id='yPSzZ'><style id='yPSzZ'><dir id='yPSzZ'><q id='yPSzZ'></q></dir></style></legend>

                <bdo id='yPSzZ'></bdo><ul id='yPSzZ'></ul>

                • 本文介绍了google.loader.clientlocation 是否仍受支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我使用 google.loader.ClientLocation 做了一些测试,来自:

                  I have made some tests using google.loader.ClientLocation from:

                  • http://www.google.com/jsapi

                  但我的测试结果为 null:

                  But I get null for the test:

                  if (google.loader.ClientLocation) 
                  

                  这是 google 找不到 IP 信息时的行为.

                  This is the behaviour when google does not find information for IP.

                  我搜索了 StackOverflow,有很多关于它的问题,但没有好的答案.

                  I searched StackOverflow and there are a lot of questions regarding it but no good answers.

                  我在网上搜索并看到了这两个链接:

                  I searched the net and saw these 2 links:

                  • https://groups.google.com/forum/?fromgroups=#!topic/google-ajax-search-api/8q_oG-Y9fp8
                  • http://code.google.com/p/google-ajax-apis/issues/detail?id=586
                  • https://groups.google.com/forum/?fromgroups=#!topic/google-ajax-search-api/rzoIh4RrtOQ

                  这似乎是说应该使用导航器 HTML 地理位置.

                  Which seem to say the navigator HTML geo location should be used.

                  Google API 文档不再提及.

                  Google API documentation does not mention it anymore.

                  我想确认 Google google.loader.clientlocation 是否仍在工作?

                  我的代码如下:

                  <html>
                  <head>
                    <script type="text/javascript" src="http://www.google.com/jsapi"></script>
                  </head>
                  <body>
                  <script type="text/javascript"> 
                  function geoTest() {
                  
                      if (google.loader.ClientLocation) {
                  
                          var latitude = google.loader.ClientLocation.latitude;
                          var longitude = google.loader.ClientLocation.longitude;
                          var city = google.loader.ClientLocation.address.city;
                          var country = google.loader.ClientLocation.address.country;
                          var country_code = google.loader.ClientLocation.address.country_code;
                          var region = google.loader.ClientLocation.address.region;
                  
                          var text = 'Your Location<br /><br />Latitude: ' + latitude + '<br />Longitude: ' + longitude + '<br />City: ' + city + '<br />Country: ' + country + '<br />Country Code: ' + country_code + '<br />Region: ' + region;
                  
                      } else {
                  
                          var text = 'Google was not able to detect your location';
                  
                      }
                  
                      document.write(text);
                  }
                  
                  geoTest();
                  
                  </script>
                  </body>
                  </html>
                  

                  推荐答案

                  这个 API 似乎有点弃用",尽管它仍然适用于某些 IP.

                  It seems this API is kind of "deprecated" although it still works for some IPs.

                  这是我从这里得到的答案:

                  This is the answer I got from here:

                  • http://code.google.com/p/google-ajax-apis/issues/detail?id=586

                  Loader 中的地理定位功能本身并没有被淘汰.几年前我们停止记录它,并推荐了基于 HTML 的解决方案,因为它们提高了准确性,但目前尚未从加载器中删除该功能本身.谢谢!

                  The geolocation functionality in the Loader hasn't been retired, per se. We stopped documenting it several years ago and have recommended the HTML-based solutions due to their improved accuracy, but the functionality itself has not been removed from the Loader at this time. Thanks!

                  所以当没有为 IP 找到位置时,google.loader.ClientLocation 为空

                  So when location is not found for IP, google.loader.ClientLocation is null

                  这篇关于google.loader.clientlocation 是否仍受支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:无法应对 navigator.geolocation 的异步特性 下一篇:地理位置离我的位置最近的位置(纬度,经度)

                  相关文章

                  最新文章

                • <small id='E8Yhp'></small><noframes id='E8Yhp'>

                  <legend id='E8Yhp'><style id='E8Yhp'><dir id='E8Yhp'><q id='E8Yhp'></q></dir></style></legend>

                    • <bdo id='E8Yhp'></bdo><ul id='E8Yhp'></ul>
                    <tfoot id='E8Yhp'></tfoot>

                    1. <i id='E8Yhp'><tr id='E8Yhp'><dt id='E8Yhp'><q id='E8Yhp'><span id='E8Yhp'><b id='E8Yhp'><form id='E8Yhp'><ins id='E8Yhp'></ins><ul id='E8Yhp'></ul><sub id='E8Yhp'></sub></form><legend id='E8Yhp'></legend><bdo id='E8Yhp'><pre id='E8Yhp'><center id='E8Yhp'></center></pre></bdo></b><th id='E8Yhp'></th></span></q></dt></tr></i><div id='E8Yhp'><tfoot id='E8Yhp'></tfoot><dl id='E8Yhp'><fieldset id='E8Yhp'></fieldset></dl></div>