<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智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                完成驗證用戶名案例,要求用戶名唯一,就是不能有重復。 頁面中有一個文本框,當失去焦點的時候,驗證輸出的內容是否已經存在。 # 1、創建所需文件 創建03chkusername.html: ![](https://img.kancloud.cn/4e/a8/4ea88767f64b7f3dc7403a78f50a9a8d_673x39.png) 創建03chkusername.php ![](https://img.kancloud.cn/e9/e6/e9e6f1c01ca04fb92e33e70c33cc4b3a_721x163.png) # 2、當input失去焦點,準備發送 ![](https://img.kancloud.cn/9c/88/9c881230fce625bbe5df8e4e9aa51feb_944x437.png) 因為用get方式請求,所以參數直接寫到url上即可。服務器端獲取地址欄的參數,同樣使用$_GET來獲取。 # 3、發送請求 調用Ajax對象的send方法發送請求到服務器。 ![](https://img.kancloud.cn/13/ce/13ce7f6c8ac6b39f15c27660e4dadc41_946x419.png) # 4、服務器接收數據并判斷 ![](https://img.kancloud.cn/db/81/db81f5bd9aa2ee9ef9ec87ff3de03bde_699x412.png) 判斷完成,將判斷的結果返回給瀏覽器。echo出來的東西就是返回給瀏覽器的內容。 測試: ![](https://img.kancloud.cn/d8/92/d8929419ccc5c000d9de75fa24e71d7b_1257x605.png) # 5、接收服務器返回的數據,并處理 ![](https://img.kancloud.cn/45/57/4557fc3c953413c9289840d70754e51f_1068x486.png) 經過測試,發現并沒有成功接收到服務器返回的數據。通過console.log(result);查看到的結果什么都么有。 # 6、監聽Ajax執行狀態 發送請求完畢,不應該馬上就接收服務器返回的數據,應該判斷一下Ajax進行到哪一步了。如果說進行到最后一步了,即服務器返回數據完畢,這個時候才應該獲取服務器返回的數據。 Ajax對象中用onreadystatechange屬性(事件),來監聽(檢測)Ajax執行到哪一步了。 Ajax對象中用readyState屬性來表示Ajax的狀態,具體是readyState屬性值如下: ![](https://img.kancloud.cn/44/9e/449eb29c4155820cc76ca1760479aae5_788x151.png) ![](https://img.kancloud.cn/76/73/7673156c7f4065503f4c1a11adf228ec_1142x557.png) # 7、使用Ajax步驟總結 ![](https://img.kancloud.cn/45/e2/45e25d914dfab68515deb6ac67eeb40d_1138x490.png)
                  <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>

                              哎呀哎呀视频在线观看