久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <legend id='egCRT'><style id='egCRT'><dir id='egCRT'><q id='egCRT'></q></dir></style></legend>
      <i id='egCRT'><tr id='egCRT'><dt id='egCRT'><q id='egCRT'><span id='egCRT'><b id='egCRT'><form id='egCRT'><ins id='egCRT'></ins><ul id='egCRT'></ul><sub id='egCRT'></sub></form><legend id='egCRT'></legend><bdo id='egCRT'><pre id='egCRT'><center id='egCRT'></center></pre></bdo></b><th id='egCRT'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='egCRT'><tfoot id='egCRT'></tfoot><dl id='egCRT'><fieldset id='egCRT'></fieldset></dl></div>
      1. <tfoot id='egCRT'></tfoot>

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

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

        Google Maps/Places 'autocomplete' API 可以通過 AJ

        Can Google Maps/Places #39;autocomplete#39; API be used via AJAX?(Google Maps/Places autocomplete API 可以通過 AJAX 使用嗎?)

          <i id='CbGvt'><tr id='CbGvt'><dt id='CbGvt'><q id='CbGvt'><span id='CbGvt'><b id='CbGvt'><form id='CbGvt'><ins id='CbGvt'></ins><ul id='CbGvt'></ul><sub id='CbGvt'></sub></form><legend id='CbGvt'></legend><bdo id='CbGvt'><pre id='CbGvt'><center id='CbGvt'></center></pre></bdo></b><th id='CbGvt'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CbGvt'><tfoot id='CbGvt'></tfoot><dl id='CbGvt'><fieldset id='CbGvt'></fieldset></dl></div>

            <legend id='CbGvt'><style id='CbGvt'><dir id='CbGvt'><q id='CbGvt'></q></dir></style></legend>
              <bdo id='CbGvt'></bdo><ul id='CbGvt'></ul>

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

                <tbody id='CbGvt'></tbody>
              <tfoot id='CbGvt'></tfoot>

                1. 本文介紹了Google Maps/Places 'autocomplete' API 可以通過 AJAX 使用嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試使用 Google Places 自動完成 API 在 Web 應(yīng)用程序上使用企業(yè)數(shù)據(jù)預(yù)先填寫表單,以簡化數(shù)據(jù)輸入.API 非常簡單,但它似乎不想接受 XHR.

                  I'm trying to use the Google Places autocomplete API to pre-fill a form on a web application with Establishment data to ease data-entry. The API is pretty straightforward, but it doesn't seem to want to accept the XHR.

                  $.getJSON("https://maps.googleapis.com/maps/api/place/autocomplete/json",{
                    input: input.term,
                    sensor: false,
                    types: 'establishment',
                    location: '40.01496,-105.27029',
                    radius: 10000,
                    key: Config.googleplaceskey
                  },function(places_response){
                      //Some other code.
                  });
                  

                  我在控制臺中得到了這個:

                  I get this in the console:

                  XMLHttpRequest 無法加載 https://maps.googleapis.com/maps/api/place/autocomplete/json?input=At&sensor=false&types=establishment&location=40.01496%2C-105.27029&半徑=10000&key=AIzaSyDKzUgcLklQE_U5494vHq_SzrFakNHugaQ.Access-Control-Allow-Origin 不允許來源 http://localhost:8086.

                  這難道不是 API 的用途嗎?任何人都知道一種解決方法,或者我可以發(fā)送一些額外的參數(shù)來使它工作嗎?

                  Is this somehow not what the API is meant for? Anyone know a workaround, or some kind of extra parameter(s) I could send to make it work?

                  更新:

                  這是此調(diào)用的 API 文檔的鏈接.父文檔實(shí)際上甚至有 JavaScript JSON 解析示例.真的很困惑為什么會在服務(wù)器端關(guān)閉它.

                  Here's the link to the API documentation for this call. The parent docs actually even have JavaScript JSON-parsing examples. Really confusing why this would be shut down on the server side.

                  http://code.google.com/apis/maps/文檔/places/autocomplete.html

                  推薦答案

                  下面是一個代碼片段,供以后遇到這種情況的讀者參考.

                  Here is a code snippet for future readers who come across this scenario.

                  使用Places API"而不是Maps API",此代碼段使用 Google 返回的數(shù)據(jù)填充我的表單元素(包括用于自動完成的輸入).

                  Using the "Places API" rather than the "Maps API", this code snippet fills in my form elements (including the input that is used to autocomplete) with returned data from Google.

                  /* Use google place API to auto complete the address field and populate form inputs */
                  function addressAutoComplete(){
                      var planAddress = document.getElementById('mps_planaddress'),
                          planCity = document.getElementById('mps_plancity'),
                          planCounty = document.getElementById('mps_plancounty'),
                          planZip = document.getElementById('mps_planzip'),
                          planSub = document.getElementById('mps_plansubdivision'),
                          options = {
                              componentRestrictions: {country: 'us'}
                      };
                      autocomplete = new google.maps.places.Autocomplete(planAddress, options);
                      // After the user selects the address
                      google.maps.event.addListener(autocomplete, 'place_changed', function() {
                          planSub.focus();
                          var place = autocomplete.getPlace();
                          planAddress.value = place.name;
                          planCity.value = place.address_components[2].long_name;
                          planCounty.value = place.address_components[3].long_name;
                          planZip.value = place.address_components[6].long_name;
                      });
                  }
                  

                  在place_changed"的自動完成上放置一個監(jiān)聽器(他們從列表中選擇了一些東西),然后用返回的數(shù)據(jù)填充輸入.

                  Put a listener on the autocomplete for "place_changed" (they chose something from the list) and then fill in the inputs with the data returned.

                  所有這些都列在 Place Library Google 頁面上.

                  這篇關(guān)于Google Maps/Places 'autocomplete' API 可以通過 AJAX 使用嗎?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

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

                    <legend id='MazIb'><style id='MazIb'><dir id='MazIb'><q id='MazIb'></q></dir></style></legend>
                      • <bdo id='MazIb'></bdo><ul id='MazIb'></ul>
                      • <tfoot id='MazIb'></tfoot>

                        • <i id='MazIb'><tr id='MazIb'><dt id='MazIb'><q id='MazIb'><span id='MazIb'><b id='MazIb'><form id='MazIb'><ins id='MazIb'></ins><ul id='MazIb'></ul><sub id='MazIb'></sub></form><legend id='MazIb'></legend><bdo id='MazIb'><pre id='MazIb'><center id='MazIb'></center></pre></bdo></b><th id='MazIb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MazIb'><tfoot id='MazIb'></tfoot><dl id='MazIb'><fieldset id='MazIb'></fieldset></dl></div>
                              <tbody id='MazIb'></tbody>
                            主站蜘蛛池模板: 在线成人av| 超碰成人免费 | 日韩三级视频 | 精品国产一区二区三区久久 | 久久国产精品久久国产精品 | 中文字幕成人免费视频 | 国产精品夜夜夜一区二区三区尤 | 九九伊人sl水蜜桃色推荐 | 国产伦精品一区二区三毛 | 成人精品一区二区三区中文字幕 | 亚洲国产成人在线 | 中文字幕第十页 | 高清国产午夜精品久久久久久 | 国产色婷婷久久99精品91 | 黄色欧美视频 | 亚洲人精品 | 精品视频一区二区三区 | 在线精品一区二区三区 | 欧美日韩视频在线第一区 | 欧美在线观看一区 | 亚洲电影一区二区三区 | 亚洲精品欧洲 | 亚洲精品国产成人 | 99热这里都是精品 | 欧美一级大片免费观看 | 久草.com| 曰批视频在线观看 | 国产精品视频97 | 欧美成人免费在线视频 | 亚洲欧洲日本国产 | 日韩欧美在线一区 | 伊人网伊人 | 久久国产精品免费 | 亚洲一区二区三区四区在线观看 | 天天av综合 | 国产美女一区二区 | 日韩视频在线一区 | 成人在线精品视频 | 国产一区二区免费 | 国产一区二区三区久久久久久久久 | 婷婷在线网站 |