久久久久久久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) 問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(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.

                  我們有一個使用多個域并讀取圖像數(shù)據(jù)的 JS/HTML5 應(yīng)用程序.我們正在從另一個域加載 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 中的圖像對象上設(shè)置這個:

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

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

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

                  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 是否需要做更多工作才能將這些跨域圖像視為無污染?

                  更新:

                  我注意到上一個問題的這個答案.有趣的是 this JSFiddle 也不適用于 IE10 - 任何人都可以確認這不起作用在他們的 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 可以解決這個問題:

                  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) 問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (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>
                            主站蜘蛛池模板: 中文字幕在线观看 | 免费成人在线网站 | av一二三四 | 国产精品视频久久久久久 | 日日干日日操 | 亚洲激情一级片 | 成人精品一区 | 国产精品视频在线免费观看 | 亚洲精品中文字幕中文字幕 | 欧美一区二区久久 | 国产一区二区三区在线视频 | 激情综合五月 | 一级在线观看 | 国产精品一区二区三区在线 | 成人在线观看中文字幕 | 欧美视频免费在线 | h视频在线免费 | 韩国久久 | 日本网站免费在线观看 | 日韩在线不卡视频 | 欧美黄色片 | 日韩精品一区二区三区老鸭窝 | 日韩精品一区二区三区中文字幕 | 99久久精品国产一区二区三区 | 亚洲综合色视频在线观看 | 精品国产欧美一区二区三区成人 | av中文字幕网 | 国产一区二区在线视频 | 玖玖精品 | 亚洲国产一区二区三区四区 | 欧美久久久久 | 亚洲精品99 | 亚洲中午字幕 | 色毛片| 欧美不卡一区二区三区 | 亚洲国产成人精品女人久久久 | www.天天操.com | 亚洲一区二区三区国产 | 91电影在线播放 | 欧美成人精品在线观看 | 精品国产免费人成在线观看 |