luoluo-snow

1.创建XMLHttpRequest

let xhr=new XMLHttpRequest;

2.连接服务器

xhr.open("get","goods.json",true)

true代表异步,false代表同步。goods.json代表请求的路径

3.向服务器发送请求

xhr.send()

4.接受服务器响应的数据

ajax的作用:向http服务器发送请求,并可以接收到http服务器响应的数据

分类:

技术点:

相关文章:

  • 2021-11-05
  • 2021-11-05
  • 2021-09-13
  • 2021-11-05
  • 2021-08-11
  • 2021-12-07
猜你喜欢
  • 2021-10-28
  • 2021-12-02
  • 2022-12-23
  • 2021-12-13
  • 2021-12-16
相关资源
相似解决方案