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

  • <small id='kVcPg'></small><noframes id='kVcPg'>

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

    1. <legend id='kVcPg'><style id='kVcPg'><dir id='kVcPg'><q id='kVcPg'></q></dir></style></legend>

    2. <tfoot id='kVcPg'></tfoot>

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

        純 JavaScript 發送沒有表單的 POST 數據

        Pure JavaScript Send POST Data Without a Form(純 JavaScript 發送沒有表單的 POST 數據)

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

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

                  <tbody id='XyAYC'></tbody>
                • 本文介紹了純 JavaScript 發送沒有表單的 POST 數據的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  有沒有一種方法可以使用 POST 方法發送數據而無需使用表單并且僅使用純 JavaScript(不是 jQuery $.post())刷新頁面?也許是 httprequest 或者別的什么(只是現在找不到)?

                  Is there a way to send data using the POST method without a form and without refreshing the page using only pure JavaScript (not jQuery $.post())? Maybe httprequest or something else (just can't find it now)?

                  推薦答案

                  可以發送并插入數據到body:

                  You can send it and insert the data to the body:

                  var xhr = new XMLHttpRequest();
                  xhr.open("POST", yourUrl, true);
                  xhr.setRequestHeader('Content-Type', 'application/json');
                  xhr.send(JSON.stringify({
                      value: value
                  }));
                  

                  順便說一下,獲取請求:

                  By the way, for get request:

                  var xhr = new XMLHttpRequest();
                  // we defined the xhr
                  
                  xhr.onreadystatechange = function () {
                      if (this.readyState != 4) return;
                  
                      if (this.status == 200) {
                          var data = JSON.parse(this.responseText);
                  
                          // we get the returned data
                      }
                  
                      // end of state change: it can be after some time (async)
                  };
                  
                  xhr.open('GET', yourUrl, true);
                  xhr.send();
                  

                  這篇關于純 JavaScript 發送沒有表單的 POST 數據的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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() 的限制?)
                  • <tfoot id='Xhxh4'></tfoot>

                        <tbody id='Xhxh4'></tbody>

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

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

                            <legend id='Xhxh4'><style id='Xhxh4'><dir id='Xhxh4'><q id='Xhxh4'></q></dir></style></legend>
                          1. 主站蜘蛛池模板: 亚洲激情在线观看 | 国产三级日本三级 | 蜜桃视频一区二区三区 | 美女久久久久久久久 | 中文字幕av亚洲精品一部二部 | 亚洲欧美日韩在线 | 成人九区 | 欧美一区免费 | 91视频18| 国产精品v | 国内精品视频免费观看 | 精产嫩模国品一二三区 | 精品久久久久一区二区国产 | 天久久| 男女视频免费 | 91精品国产综合久久精品 | 欧美一级黄色片 | 国产亚洲精品美女久久久久久久久久 | 日韩精品免费视频 | 高清av一区 | 巨大荫蒂视频欧美另类大 | 国产高清在线视频 | 精品中文字幕在线观看 | 免费看的黄网站 | 亚洲成人精品在线 | 97精品视频在线观看 | 国产一区二区三区免费 | 欧美日韩中文在线 | 免费中文字幕日韩欧美 | 日韩一区二区三区在线观看视频 | 亚洲成人免费视频 | 综合激情av | 麻豆va| 国产亚洲一区二区三区在线 | 久久美女视频 | 天堂三级 | 色婷婷av一区二区三区软件 | 日韩国产中文字幕 | 中文字幕视频在线观看免费 | 色综合久久天天综合网 | 成人免费视频在线观看 |