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

  • <legend id='fuKm4'><style id='fuKm4'><dir id='fuKm4'><q id='fuKm4'></q></dir></style></legend>
    <tfoot id='fuKm4'></tfoot>

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

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

      1. IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題

        IE10 and Cross-origin resource sharing (CORS) issues with Image / Canvas(IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題)
          <tbody id='4ZAI5'></tbody>
              <i id='4ZAI5'><tr id='4ZAI5'><dt id='4ZAI5'><q id='4ZAI5'><span id='4ZAI5'><b id='4ZAI5'><form id='4ZAI5'><ins id='4ZAI5'></ins><ul id='4ZAI5'></ul><sub id='4ZAI5'></sub></form><legend id='4ZAI5'></legend><bdo id='4ZAI5'><pre id='4ZAI5'><center id='4ZAI5'></center></pre></bdo></b><th id='4ZAI5'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='4ZAI5'><tfoot id='4ZAI5'></tfoot><dl id='4ZAI5'><fieldset id='4ZAI5'></fieldset></dl></div>

              <small id='4ZAI5'></small><noframes id='4ZAI5'>

                <bdo id='4ZAI5'></bdo><ul id='4ZAI5'></ul>

                <legend id='4ZAI5'><style id='4ZAI5'><dir id='4ZAI5'><q id='4ZAI5'></q></dir></style></legend>

                • <tfoot id='4ZAI5'></tfoot>
                • 本文介紹了IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我的印象是 Internet Explorer 10 完全支持 CORS,但現(xiàn)在我不確定了.

                  I was under the impression that Internet Explorer 10 fully supported CORS, but now I'm not sure.

                  我們有一個(gè)使用多個(gè)域并讀取圖像數(shù)據(jù)的 JS/HTML5 應(yīng)用程序.我們正在從另一個(gè)域加載 JS 中的圖像,將圖像 imageDraw()ing 到我們的畫布,然后在畫布上使用 getImageData.(我們沒有使用跨域 XMLHttpRequests).為此,我們必須在提供圖像的服務(wù)器上設(shè)置響應(yīng)標(biāo)頭:

                  We have a JS/HTML5 App that uses multiple domains, and reads image data. We are loading images in the JS from another domain, imageDraw()ing the image to our canvas, and then using getImageData on the canvas. (We aren't using cross-domain XMLHttpRequests). For this to work we have had to set response headers on the server that's serving the images:

                  access-control-allow-origin: *
                  access-control-allow-credentials: true
                  

                  并在加載前在 JS 中的圖像對(duì)象上設(shè)置這個(gè):

                  And set this on the image object in the JS before loading:

                  image.crossOrigin = '匿名';//也試過小寫

                  這適用于所有新瀏覽器,除了 IE10,當(dāng)我們嘗試讀取數(shù)據(jù)時(shí)會(huì)引發(fā)安全錯(cuò)誤.

                  This is working fine for all new browsers, apart from IE10 which is throwing security errors when we try to read the data.

                  SCRIPT5022: SecurityError
                  

                  IE10 是否需要做更多工作才能將這些跨域圖像視為無污染?

                  更新:

                  我注意到上一個(gè)問題的這個(gè)答案.有趣的是 this JSFiddle 也不適用于 IE10 - 任何人都可以確認(rèn)這不起作用在他們的 IE10 中?

                  I noticed this answer to a previous question. Interestingly this JSFiddle also does not work for IE10 - can anyone confirm that this does not work in their IE10?

                  推薦答案

                  不幸的是,即使正確設(shè)置了 CORS 標(biāo)頭,IE10 仍然是唯一不支持繪制到 Canvas 的圖像的 CORS 的流行瀏覽器.但是通過 XMLHttpRequest 可以解決這個(gè)問題:

                  Unfortunately, IE10 still remains the only popular browser that doesn't support CORS for image drawn to Canvas even when CORS headers are properly set. But there is workaround for that via XMLHttpRequest:

                  var xhr = new XMLHttpRequest();
                  xhr.onload = function () {
                      var url = URL.createObjectURL(this.response), img = new Image();
                      img.onload = function () {
                          // here you can use img for drawing to canvas and handling
                          // ...
                          // don't forget to free memory up when you're done (you can do this as soon as image is drawn to canvas)
                          URL.revokeObjectURL(url);
                      };
                      img.src = url;
                  };
                  xhr.open('GET', url, true);
                  xhr.responseType = 'blob';
                  xhr.send();
                  

                  這篇關(guān)于IE10 和 Image/Canvas 的跨域資源共享 (CORS) 問題的文章就介紹到這了,希望我們推薦的答案對(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?)
                  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ù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請(qǐng)求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)
                      <tbody id='miGnX'></tbody>

                    <tfoot id='miGnX'></tfoot>

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

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

                            <legend id='miGnX'><style id='miGnX'><dir id='miGnX'><q id='miGnX'></q></dir></style></legend>
                          • <i id='miGnX'><tr id='miGnX'><dt id='miGnX'><q id='miGnX'><span id='miGnX'><b id='miGnX'><form id='miGnX'><ins id='miGnX'></ins><ul id='miGnX'></ul><sub id='miGnX'></sub></form><legend id='miGnX'></legend><bdo id='miGnX'><pre id='miGnX'><center id='miGnX'></center></pre></bdo></b><th id='miGnX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='miGnX'><tfoot id='miGnX'></tfoot><dl id='miGnX'><fieldset id='miGnX'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美aaa级 | 亚洲国产福利视频 | 亚洲午夜精品一区二区三区他趣 | av日日操| 久久精品aaa| 91伊人| 国产乱码精品一区二区三区五月婷 | 日本中文在线视频 | 免费的日批视频 | 在线国产中文字幕 | 成人在线一区二区三区 | 天天爱爱网 | 久草在线 | 国产欧美一区二区三区久久 | 成人欧美一区二区三区黑人孕妇 | 成人免费淫片aa视频免费 | 亚洲国产电影 | 国产一级淫片免费视频 | 日日骚视频 | 国产成人精品久久二区二区91 | 中文字幕日韩欧美 | 欧美精品欧美精品系列 | 日日操视频 | 欧美日韩亚洲系列 | 久久久久久亚洲 | 亚洲第一成人影院 | 国产精品亚洲视频 | 国产在线中文 | 一级做a毛片 | 天天看天天爽 | 日韩一区二区三区在线 | 99爱视频| 色视频www在线播放国产人成 | av在线播放网址 | 国产一区91精品张津瑜 | 久婷婷 | 一级日韩 | 国产精品成人在线 | 亚洲 91 | 欧美日产国产成人免费图片 | 国产av毛片 |