<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                [TOC] ## 使用RESTer測試服務接口 > 接口測試可以在瀏覽器中安裝RESTer擴展插件,通過插件可以快速的模擬表單發送實現各種請求。 在FireFox瀏覽器中安裝RESTer擴展插件,啟動插件輸入: ~~~ http://localhost:3000/api.php?action=getBookInfo&id=1 ~~~ 代碼說明: 該請求調用getBookInfo接口,并傳遞參數id,設置參數的值為1。 ![](https://img.kancloud.cn/a5/c8/a5c8e9e9a0dc9986c57bb723ae15bf32_770x570.png) ## 使用Ajax調用服務接口 ~~~ <html> <head> <script> function showResult(str) { if (str.length==0) { document.getElementById("txtHint").innerHTML=""; return; } if (window.XMLHttpRequest) { // IE7+, Firefox, Chrome, Opera, Safari 瀏覽器執行的代碼 xhr=new XMLHttpRequest(); } else { //IE6, IE5 瀏覽器執行的代碼 xhr=new ActiveXObject("Microsoft.xhr"); } xhr.onreadystatechange=function() { if (xhr.readyState==4 && xhr.status==200) { document.getElementById("txtHint").innerHTML= JSON.stringify(xhr.response); console.log(xhr.response) } } xhr.responseType ="json"; //指定返回的數據類型為JSON格式 xhr.open("GET","api.php?action=getBookInfo&id="+str,true); xhr.send(); } </script> </head> <body> <p><b>在輸入框中輸入一個圖書ID:</b></p> <form> ID: <input type="text" onkeyup="showResult(this.value)"> </form> <p>返回值: <span id="txtHint"></span></p> </body> </html> ~~~
                  <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>

                              哎呀哎呀视频在线观看