pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

      <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="lzfj5jh" 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="jpb53p1" 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 使用嗎?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試使用 Google Places 自動完成 API 在 Web 應用程序上使用企業數據預先填寫表單,以簡化數據輸入.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 的用途嗎?任何人都知道一種解決方法,或者我可以發送一些額外的參數來使它工作嗎?

                  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?

                  更新:

                  這是此調用的 API 文檔的鏈接.父文檔實際上甚至有 JavaScript JSON 解析示例.真的很困惑為什么會在服務器端關閉它.

                  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 返回的數據填充我的表單元素(包括用于自動完成的輸入).

                  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"的自動完成上放置一個監聽器(他們從列表中選擇了一些東西),然后用返回的數據填充輸入.

                  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 頁面上.

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

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

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  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標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  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="hjvbzz5" id='MazIb'><tfoot id='MazIb'></tfoot><dl id='MazIb'><fieldset id='MazIb'></fieldset></dl></div>
                              <tbody id='MazIb'></tbody>
                            主站蜘蛛池模板: 耐酸泵,耐腐蚀真空泵,耐酸真空泵-淄博华舜耐腐蚀真空泵有限公司 精密模具-双色注塑模具加工-深圳铭洋宇通 | 南京办公用品网-办公文具用品批发-打印机耗材采购 | 北京印刷厂_北京印刷_北京印刷公司_北京印刷厂家_北京东爵盛世印刷有限公司 | 学习虾-免费的学习资料下载平台 雪花制冰机(实验室雪花制冰机)百科 | 氧氮氢联合测定仪-联测仪-氧氮氢元素分析仪-江苏品彦光电 | 高压无油空压机_无油水润滑空压机_水润滑无油螺杆空压机_无油空压机厂家-科普柯超滤(广东)节能科技有限公司 | 烽火安全网_加密软件、神盾软件官网| 碳钢法兰厂家,非标法兰,定制异型,法兰生产厂家-河北九瑞管道 | 英国公司注册-新加坡公司注册-香港公司开户-离岸公司账户-杭州商标注册-杭州优创企业 | 青岛美佳乐清洁工程有限公司|青岛油烟管道清洗|酒店|企事业单位|学校工厂厨房|青岛油烟管道清洗 插针变压器-家用电器变压器-工业空调变压器-CD型电抗器-余姚市中驰电器有限公司 | 短信营销平台_短信群发平台_106短信发送平台-河南路尚 | 电机保护器-电动机综合保护器-浙江开民 | 热缩管切管机-超声波切带机-织带切带机-无纺布切布机-深圳市宸兴业科技有限公司 | 济宁工业提升门|济宁电动防火门|济宁快速堆积门-济宁市统一电动门有限公司 | 体检车_移动CT车_CT检查车_CT车_深圳市艾克瑞电气有限公司移动CT体检车厂家-深圳市艾克瑞电气有限公司 | 板式换网器_柱式换网器_自动换网器-郑州海科熔体泵有限公司 | 商秀—企业短视频代运营_抖音企业号托管 | 温湿度记录纸_圆盘_横河记录纸|霍尼韦尔记录仪-广州汤米斯机电设备有限公司 | 铣刨料沥青破碎机-沥青再生料设备-RAP热再生混合料破碎筛分设备 -江苏锡宝重工 | 北京易通慧公司从事北京网站优化,北京网络推广、网站建设一站式服务商-北京网站优化公司 | 上海道勤塑化有限公司| 蜗轮丝杆升降机-螺旋升降机-丝杠升降机厂家-润驰传动 | 郑州爱婴幼师学校_专业幼师培训_托育师培训_幼儿教育培训学校 | 潜水搅拌机-双曲面搅拌机-潜水推进器|奥伯尔环保 | RS系列电阻器,RK_RJ启动调整电阻器,RQ_RZ电阻器-上海永上电器有限公司 | 六维力传感器_六分量力传感器_模腔压力传感器-南京数智微传感科技有限公司 | 电机修理_二手电机专家-河北豫通机电设备有限公司(原石家庄冀华高压电机维修中心) | 珠海白蚁防治_珠海灭鼠_珠海杀虫灭鼠_珠海灭蟑螂_珠海酒店消杀_珠海工厂杀虫灭鼠_立净虫控防治服务有限公司 | 纯水设备_苏州皙全超纯水设备水处理设备生产厂家 | 空压机商城|空气压缩机|空压机配件-压缩机网旗下商城 | 新疆散热器,新疆暖气片,新疆电锅炉,光耀暖通公司 | 天津力值检测-天津管道检测-天津天诚工程检测技术有限公司 | 缠膜机|缠绕包装机|无纺布包装机-济南达伦特机械设备有限公司 | 不干胶标签,不干胶标签纸_厂家-山东同力胶粘制品 | 锂电池砂磨机|石墨烯砂磨机|碳纳米管砂磨机-常州市奥能达机械设备有限公司 | 北京网站建设-企业网站建设-建站公司-做网站-北京良言多米网络公司 | 一体式钢筋扫描仪-楼板测厚仪-裂缝检测仪-泰仕特(北京) | 真石漆,山东真石漆,真石漆厂家,真石漆价格-山东新佳涂料有限公司 | 电车线(用于供电给电车的输电线路)-百科 | 铝合金线槽_铝型材加工_空调挡水板厂家-江阴炜福金属制品有限公司 | 复合土工膜厂家|hdpe防渗土工膜|复合防渗土工布|玻璃纤维|双向塑料土工格栅-安徽路建新材料有限公司 |