<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                [TOC] >[success] # ajax發送post請求 <br/> ~~~ 'post'請求必須要將請求頭設置為setRequestHeader('content-type',?'application/x-www-form-urlencoded') ~~~ <br/> >[success] ## 前端代碼 <br/> ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <script> window.onload = function () { // 點擊事件 document.querySelector('input').onclick = function () { // 1. 創建對象 var xhr = new XMLHttpRequest(); // 2. 設置請求行(get請求數據寫在url后面) xhr.open('post', 'postData.php'); // 3. 設置請求頭(get請求可以省略,post不發送數據也可以省略) xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded') // 3.5 注冊回調函數 xhr.onload = function () { console.log(xhr.responseText); } // 4. 請求主體發送(get請求為空,或者寫null,post請求數據寫在這里,如果沒有數據,直接為空或者寫null) // post請求發送數據寫在send中 // key=value&key2=value2 xhr.send('name=西藍花&friend=雞蛋') } } </script> </head> <body> <h2>ajax發送post請求</h2> <input type="button" value="post請求"> </body> </html> ~~~ <br/> >[success] ## 后端代碼 <br/> ~~~ <?php // 返回內容 echo '你過來了'; print_r($_POST) ?> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看