久久久久久久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 對跨域消息傳遞的好處的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                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 文件進行播放,則 flash 將不允許您讀取 mp3 文件的 id3 標簽.對于 ajax,如果目標服務器沒有允許您的域發出請求的跨域策略,則您完全無法發出請求.

                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 進行通信.例如,如果您有 youtube 視頻 iframe,您可以向該 iframe 傳遞一條消息以更改音量.通常不可能進行通信,因為 iframe 具有不同的來源,因此您無法以編程方式對 youtube iframe 執行任何操作.

                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.

                現在應該清楚使用一個或另一個的原因.CORS 允許您從另一個來源請求數據,而當您想與 iframe 內但不在同一來源的應用程序通信時,使用主窗口和 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 數據 api 播放一些視頻(CORS,可以是 JSONP、XHR 或其他).

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

                3.您現在將跨域消息傳遞給 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

                這篇關于CORS 對跨域消息傳遞的好處的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                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標頭) - IT屋-程序員軟件開發技術分
                Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                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>
                          主站蜘蛛池模板: 三区在线 | 污免费网站 | 亚洲最色网站 | 一区二区三区在线免费观看 | 成人av电影在线观看 | 国产精品永久免费视频 | 91精品国产综合久久久久久漫画 | 九九热最新地址 | 国产高清视频在线 | 国产精品久久久久久久久久久免费看 | 国产精品一区在线 | 久久久这里只有17精品 | 国产精品毛片久久久久久 | 精品一区av | 国产成人jvid在线播放 | 国产精品69毛片高清亚洲 | 亚洲免费一区二区 | 国产在线一区二 | 黑人巨大精品欧美一区二区免费 | 一级毛片网 | 91免费版在线观看 | 国产视频1区 | 九九热最新地址 | 亚洲第一成年免费网站 | 国产免费一区二区 | 国产精品美女久久久av超清 | 亚洲精品在线视频 | 亚卅毛片 | 在线观看日本网站 | 黄色毛片在线观看 | 亚洲香蕉 | 国产成人精品一区二区三区四区 | 欧美久久综合 | 久久草在线视频 | 国产黑丝av | 91精品国产91久久综合桃花 | 在线伊人网 | 综合网伊人 | 国内精品免费久久久久软件老师 | 国产一区不卡 | 精品无码久久久久久国产 |