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

    1. <small id='7LqSy'></small><noframes id='7LqSy'>

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

      CORS 對跨域消息傳遞的好處

      Benefit of CORS over cross-domain messaging(CORS 對跨域消息傳遞的好處)

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

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

              • 本文介紹了CORS 對跨域消息傳遞的好處的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                CORS 和跨域消息傳遞在我看來是一樣的:它們允許跨域通信.

                CORS and cross-domain messaging look the same to me: they allow communication across domains.

                有什么理由使用一個與另一個?

                Are there any reasons to use one vs. the other?

                推薦答案

                CORS 適用于 Flash 通常不允許的 ajax 請求或 flash 請求.例如,如果域 x 沒有跨域策略,并且您通過 flash 從那里檢索 mp3 文件進(jìn)行播放,則 flash 將不允許您讀取 mp3 文件的 id3 標(biāo)簽.對于 ajax,如果目標(biāo)服務(wù)器沒有允許您的域發(fā)出請求的跨域策略,則您完全無法發(fā)出請求.

                CORS is for ajax requests or flash requests that flash wouldn't normally allow. For example, if there is no cross-domain policy for domain x, and you retrieve an mp3 file from there via flash for playback, flash will not allow you to read the id3 tags of the mp3 file. For ajax, you flat out cannot make the request if the target server doesn't have a cross-domain policy that allows your domain to make requests.

                跨域消息傳遞允許您與文檔中來自不同來源的 iframe 進(jìn)行通信.例如,如果您有 youtube 視頻 iframe,您可以向該 iframe 傳遞一條消息以更改音量.通常不可能進(jìn)行通信,因為 iframe 具有不同的來源,因此您無法以編程方式對 youtube iframe 執(zhí)行任何操作.

                Cross-domain messaging allows you to communicate with an iframe in the document that is from different origin. For example, if you have youtube video iframe, you may pass a message to that iframe to change volume. Normally no communication wouldn't be possible because the iframe has a different origin, so you could not do anything with the youtube iframe programmatically.

                現(xiàn)在應(yīng)該清楚使用一個或另一個的原因.CORS 允許您從另一個來源請求數(shù)據(jù),而當(dāng)您想與 iframe 內(nèi)但不在同一來源的應(yīng)用程序通信時,使用主窗口和 iframe 之間的消息傳遞.

                The reasons to use one or another, should be now clear. CORS allows you to request data from another origin while message passing between main window and an iframe is used when you want to communicate with an app that is inside the iframe but is not in the same origin.

                一個實際的例子:

                1.您有一個帶有 youtube 播放器的 iframe.

                1.You have an iframe that has a youtube player.

                2.您請求從 youtube 數(shù)據(jù) api 播放一些視頻(CORS,可以是 JSONP、XHR 或其他).

                2.You request some videos to play from youtube data api (CORS, could be JSONP, XHR or whatever).

                3.您現(xiàn)在將跨域消息傳遞給 iframe 以開始播放您在第 2 步中請求的任何視頻

                3.You now pass a cross-domain message to the iframe to start playing any of the video you requested in step #2

                這篇關(guān)于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='rW2Mk'></tbody>
                  <legend id='rW2Mk'><style id='rW2Mk'><dir id='rW2Mk'><q id='rW2Mk'></q></dir></style></legend>
                  <tfoot id='rW2Mk'></tfoot>

                  1. <small id='rW2Mk'></small><noframes id='rW2Mk'>

                    <i id='rW2Mk'><tr id='rW2Mk'><dt id='rW2Mk'><q id='rW2Mk'><span id='rW2Mk'><b id='rW2Mk'><form id='rW2Mk'><ins id='rW2Mk'></ins><ul id='rW2Mk'></ul><sub id='rW2Mk'></sub></form><legend id='rW2Mk'></legend><bdo id='rW2Mk'><pre id='rW2Mk'><center id='rW2Mk'></center></pre></bdo></b><th id='rW2Mk'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='rW2Mk'><tfoot id='rW2Mk'></tfoot><dl id='rW2Mk'><fieldset id='rW2Mk'></fieldset></dl></div>
                          <bdo id='rW2Mk'></bdo><ul id='rW2Mk'></ul>
                          主站蜘蛛池模板: 国产一区亚洲二区三区 | www.欧美| 亚洲视频在线看 | 国产精品久久久久aaaa九色 | 亚洲一区亚洲二区 | 欧美精品在线看 | 日韩在线视频观看 | 国产超碰人人爽人人做人人爱 | 久久国产精品亚洲 | 国产亚洲欧美另类一区二区三区 | 性色的免费视频 | 日本不卡免费新一二三区 | 日本一区二区三区四区 | 香蕉久久a毛片 | 国产在线一区二区三区 | 久久国产欧美日韩精品 | 亚洲日日夜夜 | 青青久久 | 国产精品成人一区 | 亚洲一区二区三区视频 | 97色在线观看免费视频 | 日韩欧美不卡 | 亚洲欧美久久 | 亚洲美女天堂网 | 人人干人人看 | 91精品国产综合久久福利软件 | 亚洲一区二区黄 | 午夜精品久久久久久久久久久久 | 久久久久国产精品一区二区 | 久久久久久久久精 | 一级黄色裸片 | 91影院在线观看 | 色婷婷av一区二区三区软件 | 欧美亚洲一区二区三区 | 中文字幕国产精品视频 | 日本 欧美 三级 高清 视频 | 中文在线一区二区 | 香蕉视频91 | 久久久久久久一区 | 欧美成人激情 | 国产探花在线精品一区二区 |