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

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

      • <bdo id='Ez68D'></bdo><ul id='Ez68D'></ul>

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

        如何獲得 XMLHttpRequest 的響應?

        How to get the response of XMLHttpRequest?(如何獲得 XMLHttpRequest 的響應?)
            • <bdo id='Sgqi1'></bdo><ul id='Sgqi1'></ul>
              <legend id='Sgqi1'><style id='Sgqi1'><dir id='Sgqi1'><q id='Sgqi1'></q></dir></style></legend>
                <tbody id='Sgqi1'></tbody>

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

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

                  <tfoot id='Sgqi1'></tfoot>
                  本文介紹了如何獲得 XMLHttpRequest 的響應?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想知道如何使用 XMLHttpRequest 加載遠程 URL 的內容并將訪問站點的 HTML 存儲在 JS 變量中.

                  I'd like to know how to use XMLHttpRequest to load the content of a remote URL and have the HTML of the accessed site stored in a JS variable.

                  說,如果我想加載和 alert() http://foo.com/bar 的 HTML.php,我該怎么做呢?

                  Say, if I wanted to load and alert() the HTML of http://foo.com/bar.php, how would I do that?

                  推薦答案

                  你可以通過XMLHttpRequest.responseTextXMLHttpRequest.onreadystatechangeXMLHttpRequest.readyState 等于 XMLHttpRequest.DONE.

                  這是一個示例(與 IE6/7 不兼容).

                  Here's an example (not compatible with IE6/7).

                  var xhr = new XMLHttpRequest();
                  xhr.onreadystatechange = function() {
                      if (xhr.readyState == XMLHttpRequest.DONE) {
                          alert(xhr.responseText);
                      }
                  }
                  xhr.open('GET', 'http://example.com', true);
                  xhr.send(null);
                  

                  為了更好的跨瀏覽器兼容性,不僅是與 IE6/7,還包括一些特定于瀏覽器的內存泄漏或錯誤,以及在觸發 ajaxical 請求時減少冗長,您可以使用 jQuery.

                  For better crossbrowser compatibility, not only with IE6/7, but also to cover some browser-specific memory leaks or bugs, and also for less verbosity with firing ajaxical requests, you could use jQuery.

                  $.get('http://example.com', function(responseText) {
                      alert(responseText);
                  });
                  

                  請注意,您必須為不在本地主機上運行時考慮 JavaScript.您可能需要考慮在您的域中創建一個代理腳本.

                  Note that you've to take the Same origin policy for JavaScript into account when not running at localhost. You may want to consider to create a proxy script at your domain.

                  這篇關于如何獲得 XMLHttpRequest 的響應?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  • <legend id='BU80c'><style id='BU80c'><dir id='BU80c'><q id='BU80c'></q></dir></style></legend>
                          <tbody id='BU80c'></tbody>

                          <tfoot id='BU80c'></tfoot>

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

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

                            <i id='BU80c'><tr id='BU80c'><dt id='BU80c'><q id='BU80c'><span id='BU80c'><b id='BU80c'><form id='BU80c'><ins id='BU80c'></ins><ul id='BU80c'></ul><sub id='BU80c'></sub></form><legend id='BU80c'></legend><bdo id='BU80c'><pre id='BU80c'><center id='BU80c'></center></pre></bdo></b><th id='BU80c'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BU80c'><tfoot id='BU80c'></tfoot><dl id='BU80c'><fieldset id='BU80c'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 日本成人中文字幕 | av入口| 午夜看片网站 | 欧美久久视频 | 在线免费激情视频 | www.中文字幕.com | 国产精品久久久久久久久久久久久 | 午夜日韩 | 欧美日韩高清一区二区三区 | 视频在线一区二区 | 精品久久久久久亚洲精品 | 日韩91| 最新国产福利在线 | 亚洲天堂免费 | 亚洲色图婷婷 | 性网站免费 | 久久久亚洲成人 | 97国产精品 | 偷拍自拍在线观看 | 亚洲精品美女视频 | www.99热这里只有精品 | 国产在线aa| 亚洲xxxxx | av天天澡天天爽天天av | 精品国产乱码一区二区三区 | 日韩www | 日韩成人在线观看 | 亚洲视频 欧美视频 | 黄色大片免费播放 | 精品久久久久久久久久久久久久久久久 | 亚洲不卡在线视频 | 国产成人免费在线观看 | 国产伦一区二区三区久久 | 区一区二在线观看 | 欧美www在线观看 | 毛片免费视频 | 欧美在线综合 | 国产精品自产拍在线观看蜜 | 国产探花在线精品一区二区 | 欧美a在线 | 国产成人精品一区二区三 |