久久久久久久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. 主站蜘蛛池模板: 亚洲欧美日韩电影 | 性视频网 | 久久久久久久久国产精品 | 美国一级黄色片 | 欧美一级大片免费观看 | 日韩精品久久久久 | 免费能直接在线观看黄的视频 | 国产午夜精品久久久久 | 国产超碰人人爽人人做人人爱 | 中文天堂在线观看 | 久久人人国产 | www.欧美视频 | 亚洲成人精品久久 | 久久久夜色精品亚洲 | 国产在线视频一区二区董小宛性色 | 91婷婷韩国欧美一区二区 | 欧美日韩一| 欧美国产精品 | 亚洲图片视频一区 | 黄色片免费 | 日本成人免费网站 | 国产精品久久久久久中文字 | 色爱综合网 | 久久精品国产a三级三级三级 | 国产精品精品久久久 | 91成人在线 | 欧洲尺码日本国产精品 | 一区二区三区视频在线观看 | 中文字幕久久精品 | 久久国产麻豆 | 成人免费在线观看 | 国产视频福利在线观看 | 日韩三区在线 | 人人人人人爽 | 国产日韩视频 | 在线国产一区 | 国产高清在线精品 | 亚洲劲爆av| 在线婷婷 | 久久精品亚洲国产奇米99 | 四虎在线播放 |