久久久久久久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 模塊未定義/未找到的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這是我的代碼:

                  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'
                  

                  當我刪除第一行時,我得到:

                  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 是網絡瀏覽器中的內置對象.

                  XMLHttpRequest is a built-in object in web browsers.

                  它不與 Node.js 一起分發.http 模塊 是從 Node 發出 HTTP 請求的內置工具.

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

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

                  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,那么有幾個第三方實現.xmlhttprequest (似乎沒有維護)和 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
                  

                • 現在你可以在你的代碼中require它.

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

                • 這篇關于XMLHttpRequest 模塊未定義/未找到的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)

                      <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>
                            主站蜘蛛池模板: 国产一区二区三区色淫影院 | 国产日韩一区二区 | 日韩一区二区在线视频 | 国产视频一区在线 | 欧美一级大片免费观看 | 欧美日韩国产一区二区三区 | 亚洲精品久久久久中文字幕欢迎你 | 7777奇米影视 | 国产亚洲一区二区在线观看 | 免费a大片 | 免费一级欧美在线观看视频 | 欧美一区二区三区视频 | 日韩伦理一区二区 | 99精品欧美一区二区三区综合在线 | 一区二区国产精品 | 免费成人午夜 | 国产精品成人在线播放 | 欧美影院 | 国产精品黄 | 亚洲天堂成人在线视频 | 国产欧美一区二区三区在线看蜜臀 | 狠狠色狠狠色综合系列 | 人人爽人人草 | 黑人巨大精品欧美一区二区免费 | 国产视频h | 精品国产91乱码一区二区三区 | 在线免费看黄 | 欧美成人免费在线视频 | 国产精品视频一区二区三区 | 四虎网站在线观看 | 91高清在线观看 | 黄在线免费观看 | av色在线| 国产在线观看网站 | 欧洲亚洲一区二区三区 | 在线观看国产精品视频 | 国产亚洲一区二区三区在线观看 | 午夜欧美a级理论片915影院 | 日韩在线观看中文字幕 | 日韩三极| 精产嫩模国品一二三区 |