XMLHttpRequest 的基本用法_new xmlhttprequest()-CSDN博客

网站介绍:文章浏览阅读2.2k次。XMLHttpRequest是浏览器内置的一个构造函数。所以使用的时候需要 new ​ 作用:基于 new 出来的 XMLHttpRequest 实例对象,可以发起 Ajax 的请求。 ​ axios 中的 axios.get()、axios.post()、axios() 方法,都是基于 XMLHttpRequest(简称:XHR) 封装主要的 4 个实现步骤:创建 xhr 对象调用 xhr.open() 函数调用 xhr.send() 函数监听 load 事件1.3 GET请求携带参数GET请求_new xmlhttprequest()