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>
                            主站蜘蛛池模板: 济南ISO9000认证咨询代理公司,ISO9001认证,CMA实验室认证,ISO/TS16949认证,服务体系认证,资产管理体系认证,SC食品生产许可证- 济南创远企业管理咨询有限公司 郑州电线电缆厂家-防火|低压|低烟无卤电缆-河南明星电缆 | 砂石生产线_石料生产线设备_制砂生产线设备价格_生产厂家-河南中誉鼎力智能装备有限公司 | IP检测-检测您的IP质量| 数码管_LED贴片灯_LED数码管厂家-无锡市冠卓电子科技有限公司 | 合同书格式和范文_合同书样本模板_电子版合同,找范文吧 | 世纪豪门官网 世纪豪门集成吊顶加盟电话 世纪豪门售后电话 | 直齿驱动-新型回转驱动和回转支承解决方案提供商-不二传动 | 钢丝绳探伤仪-钢丝绳检测仪-钢丝绳探伤设备-洛阳泰斯特探伤技术有限公司 | 罐体电伴热工程-消防管道电伴热带厂家-山东沃安电气 | 恒温油槽-恒温水槽-低温恒温槽厂家-宁波科麦仪器有限公司 | 水平筛厂家-三轴椭圆水平振动筛-泥沙震动筛设备_山东奥凯诺矿机 包装设计公司,产品包装设计|包装制作,包装盒定制厂家-汇包装【官方网站】 | 德州网站制作 - 网站建设设计 - seo排名优化 -「两山建站」 | 间甲酚,间甲酚厂家-山东祥东新材料| 全温恒温摇床-水浴气浴恒温摇床-光照恒温培养摇床-常州金坛精达仪器制造有限公司 | 精准猎取科技资讯,高效阅读科技新闻_科技猎 | 播音主持培训-中影人教育播音主持学苑「官网」-中国艺考界的贵族学校 | 压力控制器,差压控制器,温度控制器,防爆压力控制器,防爆温度控制器,防爆差压控制器-常州天利智能控制股份有限公司 | 可程式恒温恒湿试验箱|恒温恒湿箱|恒温恒湿试验箱|恒温恒湿老化试验箱|高低温试验箱价格报价-广东德瑞检测设备有限公司 | 深圳货架厂家_金丽声精品货架_广东金丽声展示设备有限公司官网 | 舞台木地板厂家_体育运动木地板_室内篮球馆木地板_实木运动地板厂家_欧氏篮球地板推荐 | 120kv/2mA直流高压发生器-60kv/2mA-30kva/50kv工频耐压试验装置-旭明电工 | 德州网站制作 - 网站建设设计 - seo排名优化 -「两山建站」 | 100_150_200_250_300_350_400公斤压力空气压缩机-舰艇航天配套厂家 | 二手电脑回收_二手打印机回收_二手复印机回_硒鼓墨盒回收-广州益美二手电脑回收公司 | PCB设计,PCB抄板,电路板打样,PCBA加工-深圳市宏力捷电子有限公司 | 不锈钢丸厂家,铝丸,铸钢丸-淄博智源铸造材料有限公司 | 塑料撕碎机_编织袋撕碎机_废纸撕碎机_生活垃圾撕碎机_废铁破碎机_河南鑫世昌机械制造有限公司 | 齿式联轴器-弹性联轴器-联轴器厂家-江苏诺兴传动联轴器制造有限公司 | 工业冷却塔维修厂家_方形不锈钢工业凉水塔维修改造方案-广东康明节能空调有限公司 | 北京征地律师,征地拆迁律师,专业拆迁律师,北京拆迁律师,征地纠纷律师,征地诉讼律师,征地拆迁补偿,拆迁律师 - 北京凯诺律师事务所 | 热工多功能信号校验仪-热电阻热电偶校验仿真仪-金湖虹润仪表 | 手持式3d激光扫描仪-便携式三维立体扫描仪-北京福禄克斯 | 浙江筋膜枪-按摩仪厂家-制造商-肩颈按摩仪哪家好-温州市合喜电子科技有限公司 | 西宁装修_西宁装修公司-西宁业之峰装饰-青海业之峰墅级装饰设计公司【官网】 | 板框压滤机-隔膜压滤机配件生产厂家-陕西华星佳洋装备制造有限公司 | 工控机-工业平板电脑-研华工控机-研越无风扇嵌入式box工控机 | 台湾Apex减速机_APEX行星减速机_台湾精锐减速机厂家代理【现货】-杭州摩森机电 | 塑料异型材_PVC异型材_封边条生产厂家_PC灯罩_防撞扶手_医院扶手价格_东莞市怡美塑胶制品有限公司 | 深圳市万色印象美业有限公司 | 变位机,焊接变位机,焊接变位器,小型变位机,小型焊接变位机-济南上弘机电设备有限公司 | 电子厂招聘_工厂招聘_普工招聘_小时工招聘信息平台-众立方招工网 |