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

  • <legend id='jV6Rd'><style id='jV6Rd'><dir id='jV6Rd'><q id='jV6Rd'></q></dir></style></legend>

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

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

        XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“A

        XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
      1. <small id='VIZXp'></small><noframes id='VIZXp'>

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

              1. <tfoot id='VIZXp'></tfoot>
                  <tbody id='VIZXp'></tbody>
                  本文介紹了XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin"標(biāo)頭的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  XMLHttpRequest 無法加載 http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Affenhausen&destinations=Achenkirch&mode=driving&language=de-DE&sensor=false.請(qǐng)求的資源上不存在Access-Control-Allow-Origin"標(biāo)頭.因此,Origin 'null' 不允許訪問.

                  XMLHttpRequest cannot load http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Affenhausen&destinations=Achenkirch&mode=driving&language=de-DE&sensor=false. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

                  Javascript 代碼如下

                  The Javascript code is as

                  function distanceCalc(){
                      start_location = $('select.start option:selected').val();
                      target_location = $('select.end option:selected').val();
                      $.get('http://maps.googleapis.com/maps/api/distancematrix/xml?origins='+start_location+'&destinations='+target_location+'&mode=driving&language=de-DE&sensor=false', function(data) {
                  

                  DreamWeaver 可以工作,但是當(dāng)我通過瀏覽器打開它時(shí),我得到了同樣的錯(cuò)誤.

                  DreamWeaver works, but when I open it via a browser, I get the same error.

                  推薦答案

                  這有點(diǎn)棘手,即使你正確設(shè)置了 CORS,它仍然會(huì)失敗.您應(yīng)該使用 Google 的內(nèi)置函數(shù)來訪問它.如果您嘗試通過 $.get() 或類似方法直接訪問它,它將失敗...查看此示例:https://developers.google.com/maps/documentation/javascript/examples/distance-matrix

                  This is a bit tricky, even if you have CORS set up properly it still fails. You should use Google's build in functions to access it. If you try to access it directly via $.get() or similar it will fail... check this example out: https://developers.google.com/maps/documentation/javascript/examples/distance-matrix

                  有趣的事實(shí),當(dāng)通過 $.get() 訪問時(shí)(我不知道為什么):

                  Interesting fact, when accessing via $.get() (I am not sure why though):

                  -THIS WORKS: http://maps.googleapis.com/maps/api/geocode/
                  
                  -THIS FAILS: http://maps.googleapis.com/maps/api/distancematrix/
                  

                  我的建議 - 不要嘗試通過 get() 獲取 json/xml.使用 google 的 API 內(nèi)置函數(shù)發(fā)送請(qǐng)求,然后正確解析響應(yīng)

                  My advice - don't try fetching json/xml via get(). Use google's API build in functions to send request and then parse the response properly

                  此示例代碼應(yīng)該可以幫助您入門:

                  This example code should get you started:

                  // var origins      = [];
                  // var destinations = [];
                  
                  var distanceMatrix  = new google.maps.DistanceMatrixService();
                  var distanceRequest = { origins: origins, destinations: destinations, travelMode: google.maps.TravelMode.DRIVING, unitSystem: google.maps.UnitSystem.METRIC, avoidHighways: false, avoidTolls: false };
                  distanceMatrix.getDistanceMatrix(distanceRequest, function(response, status) {
                      if (status != google.maps.DistanceMatrixStatus.OK) {
                          alert('Error was: ' + status);
                      }
                      else {
                          var origins      = response.originAddresses;
                          var destinations = response.destinationAddresses;
                          // rest of your code here...
                      }
                  }
                  

                  這篇關(guān)于XMLHttpRequest 無法加載,請(qǐng)求的資源上不存在“Access-Control-Allow-Origin"標(biāo)頭的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                      <tbody id='mnUQO'></tbody>
                  • <small id='mnUQO'></small><noframes id='mnUQO'>

                      <bdo id='mnUQO'></bdo><ul id='mnUQO'></ul>
                      <tfoot id='mnUQO'></tfoot>

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

                          <legend id='mnUQO'><style id='mnUQO'><dir id='mnUQO'><q id='mnUQO'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 99在线免费视频 | 福利在线观看 | 91成人精品 | 午夜男人免费视频 | 99国产精品久久久久久久 | 国产专区在线 | 日韩精品久久久 | 成人精品视频在线观看 | 在线观看免费av网站 | 精品不卡 | 日日骚网 | 亚洲综合国产 | 二区成人| 欧美一级二级在线观看 | 成人av一区| 古装三级在线播放 | 成人免费在线播放 | 久久aⅴ乱码一区二区三区 亚洲欧美综合精品另类天天更新 | 青青久草 | 四虎影院在线观看免费视频 | 蜜桃av一区二区三区 | 91精品国产一区二区在线观看 | 国产美女一区 | 一区二区三区日 | 中文字幕国产一区 | 欧美亚洲激情 | 国产精品久久久久久久久久久久久 | 国产一区久久 | www.亚洲| 国产欧美精品一区二区三区 | 紧缚调教一区二区三区视频 | 一级黄色淫片 | 国产福利在线视频 | 在线视频亚洲 | 国产精品久久久久久久粉嫩 | 久久高清亚洲 | 一级大片| 91精品在线播放 | 精品综合久久久 | 久久er99热精品一区二区 | 成人精品视频99在线观看免费 |