久久久久久久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>
                            主站蜘蛛池模板: 一区二区三区av | 久久亚洲春色中文字幕久久久 | 伊人伊成久久人综合网站 | 亚洲在线一区二区三区 | 欧美色综合 | 欧美日韩中文国产一区发布 | 国产中文一区二区三区 | 中文字幕在线视频网站 | 亚洲图片一区二区三区 | 国产伦精品一区二区三区视频金莲 | 三级在线观看 | 久久亚洲经典 | 91精品国产91久久综合桃花 | 国产激情亚洲 | 久久久久久亚洲精品 | 中文字幕在线视频观看 | 成人精品毛片国产亚洲av十九禁 | 国产精品明星裸体写真集 | 欧美日韩亚洲一区 | 欧美日韩一区二区三区四区五区 | 国产主播第一页 | 国产精品99 | www.黄色片视频 | 国产日韩久久 | 成人福利网站 | 亚洲天堂久久新 | 亚洲精品自在在线观看 | 中文字幕欧美一区 | 欧美乱码精品一区二区三区 | 狠狠婷婷综合久久久久久妖精 | 欧美成人h版在线观看 | 日本韩国欧美在线观看 | 性欧美精品一区二区三区在线播放 | 精品视频一区二区 | 四虎影院欧美 | 99久久精品免费看国产四区 | 久久精品免费 | 欧美h | 亚洲精品成人免费 | 精品免费视频 | 亚洲三级在线观看 |