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

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

  • <legend id='mRuNr'><style id='mRuNr'><dir id='mRuNr'><q id='mRuNr'></q></dir></style></legend>

        <i id='mRuNr'><tr id='mRuNr'><dt id='mRuNr'><q id='mRuNr'><span id='mRuNr'><b id='mRuNr'><form id='mRuNr'><ins id='mRuNr'></ins><ul id='mRuNr'></ul><sub id='mRuNr'></sub></form><legend id='mRuNr'></legend><bdo id='mRuNr'><pre id='mRuNr'><center id='mRuNr'></center></pre></bdo></b><th id='mRuNr'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mRuNr'><tfoot id='mRuNr'></tfoot><dl id='mRuNr'><fieldset id='mRuNr'></fieldset></dl></div>
          <bdo id='mRuNr'></bdo><ul id='mRuNr'></ul>
      1. <tfoot id='mRuNr'></tfoot>
      2. XMLHttpRequest 模塊未定義/未找到

        XMLHttpRequest module not defined/found(XMLHttpRequest 模塊未定義/未找到)

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

          <legend id='SbkXb'><style id='SbkXb'><dir id='SbkXb'><q id='SbkXb'></q></dir></style></legend>

            <tfoot id='SbkXb'></tfoot>
              <bdo id='SbkXb'></bdo><ul id='SbkXb'></ul>

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

                    <tbody id='SbkXb'></tbody>

                • 本文介紹了XMLHttpRequest 模塊未定義/未找到的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  這是我的代碼:

                  var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
                  var xhr = new XMLHttpRequest();
                  xhr.open("GET", "http://URL")
                  xhr.setRequestHeader("Content-Type: application/json", "Authorization: Basic //AuthKey");
                  xhr.send();
                  

                  我收到錯誤:

                  Cannot find module 'xmlhttprequest'
                  

                  當(dāng)我刪除第一行時,我得到:

                  When I remove the first line, I am getting:

                  XMLHttpRequest is not defined
                  

                  我到處搜索,人們到處都提到了 Node.js 的問題,但我的 Node 安裝是正確的,所以我不確定問題是什么.

                  I have searched all over and people have mentioned a problem with Node.js here and there but my installation of Node was correct so I'm not sure what the issue is.

                  推薦答案

                  XMLHttpRequest 是網(wǎng)絡(luò)瀏覽器中的內(nèi)置對象.

                  XMLHttpRequest is a built-in object in web browsers.

                  它不與 Node.js 一起分發(fā).http 模塊 是從 Node 發(fā)出 HTTP 請求的內(nèi)置工具.

                  It is not distributed with Node. The http module is the built-in tool for making HTTP requests from Node.

                  大多數(shù)從節(jié)點(diǎn)發(fā)出 HTTP 請求的人都使用具有更友好 API 的第三方庫.兩個流行的選擇是 Axios(用于 Node.js 和瀏覽器)和 node-fetch (它實(shí)現(xiàn)了瀏覽器內(nèi)置的 fetch API,是XMLhttpRequest 的現(xiàn)代替代品.

                  Most people making HTTP requests from node use a third party library with a friendlier API. Two popular choices are Axios (for use both in Node.js and browsers) and node-fetch (which implements the fetch API which is built into browsers and is a modern replacement for XMLhttpRequest.

                  如果你真的想在 Node.js 中使用 XHR,那么有幾個第三方實(shí)現(xiàn).xmlhttprequest (似乎沒有維護(hù))和 xhr2(今年有更新).

                  If you really want to use XHR in Node.js then there are a couple of third party implementations. xmlhttprequest (which seems to be unmaintained) and xhr2 (which has had an update this year).

                  1. 用 npm 安裝,

                  1. Install it with npm,

                   npm install xhr2
                  

                • 現(xiàn)在你可以在你的代碼中require它.

                   var XMLHttpRequest = require('xhr2');
                   var xhr = new XMLHttpRequest();
                  

                • 這篇關(guān)于XMLHttpRequest 模塊未定義/未找到的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  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標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)

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

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

                          • <legend id='puMyt'><style id='puMyt'><dir id='puMyt'><q id='puMyt'></q></dir></style></legend>
                            主站蜘蛛池模板: 国产精品久久久久久久久久妇女 | 国产日韩欧美电影 | 亚洲精品视频一区二区三区 | 久久久精品一区二区三区 | 久国产视频 | 国产一区二区三区久久久久久久久 | 精品综合久久久 | 中文字幕 欧美 日韩 | 欧美日韩久久 | 国产亚洲精品美女久久久久久久久久 | 国产一区精品 | 影音先锋中文在线 | 欧美成人hd | 亚洲一区视频在线播放 | 亚洲综合小视频 | 一区二区三区欧美 | 国产高清在线精品 | 玖操| 国产在线精品一区二区 | 麻豆国产一区二区三区四区 | 日韩在线日韩 | 欧美黑人狂野猛交老妇 | 国产视频在线观看一区二区三区 | 亚洲 精品 综合 精品 自拍 | 久久se精品一区精品二区 | 精品国产一级 | 亚洲精品亚洲人成人网 | 亚洲美乳中文字幕 | 久久三区 | 日韩精品无码一区二区三区 | 精品国产一区二区三区性色av | 成人综合视频在线观看 | 免费观看黄色一级片 | 另类专区成人 | www.亚洲一区二区三区 | 81精品国产乱码久久久久久 | 久久国产日韩 | 色综合视频 | 国产精品成人一区二区三区夜夜夜 | 亚洲精品久久久一区二区三区 | 在线成人免费视频 |