久久久久久久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 無法加載,請求的資源上不存在“A

        XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - 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 無法加載,請求的資源上不存在“Access-Control-Allow-Origin"標頭的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  XMLHttpRequest 無法加載 http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Affenhausen&destinations=Achenkirch&mode=driving&language=de-DE&sensor=false.請求的資源上不存在Access-Control-Allow-Origin"標頭.因此,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)我通過瀏覽器打開它時,我得到了同樣的錯誤.

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

                  推薦答案

                  這有點棘手,即使你正確設(shè)置了 CORS,它仍然會失敗.您應(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

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

                  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ā)送請求,然后正確解析響應(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 無法加載,請求的資源上不存在“Access-Control-Allow-Origin"標頭的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?)
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (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>
                          • 主站蜘蛛池模板: 久久不卡日韩美女 | 久久久久久亚洲精品 | 日本国产欧美 | 国产欧美精品一区二区 | 日批免费观看 | 成人国产精品 | 一区二区三区视频在线观看 | 国产一区二区三区四区三区四 | 日韩三区 | 精品一区二区免费视频 | 亚洲精品久久久久久久久久久久久 | 狠狠干天天干 | 中文字幕av一区二区三区 | 欧美精品一区二区三区四区 | 国产免费福利 | 欧美日本韩国一区二区三区 | 成人免费视频观看视频 | 国产精久久久 | 精品国产一二三区 | 免费视频二区 | 日韩成人免费视频 | 精品视频国产 | 99精品一区 | 国产www.| 一a一片一级一片啪啪 | 一级黄在线观看 | 天堂av中文在线 | 精品国产91亚洲一区二区三区www | 一区二区久久 | 欧美日韩高清在线一区 | 午夜小电影 | 91精品久久久久久久久久入口 | 亚洲永久 | 国产精品免费一区二区三区四区 | 日日操夜夜操天天操 | 国产欧美在线视频 | 你懂的国产 | 国产一区二区三区视频在线观看 | 99re热精品视频 | 欧美日韩中文在线 | 毛片软件|