我的账户
猩码学苑

专注C++开发菁英教育

亲爱的游客,欢迎!

已有账号,请

如尚未注册?

张佳豪2023.6.6

[复制链接]
张佳豪 发表于 2023-6-14 19:19:32 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
// 前后端数据交互都是字符串 - json
  const xhr = new XMLHttpRequest()
  xhr.open('get', 'http:localhost:3000/jsonData')
  xhr.send()
  xhr.onload = function () {
  console.log(xhr.responseText)
  console.log(xhr.readyState) //4
   }
  readystate
  ajax状态码 0 1 2 3 4
  xhr.onreadystatechange = function () {
  console.log(xhr.readyState) //4
}

回复

使用道具 举报

关注0

粉丝0

帖子54

发布主题
大家都在学
课堂讨论
一周热帖排行最近7x24小时热帖
关注我们
专注C++菁英教育

客服电话:18009298968

客服时间:9:00-21:00

猩码学苑 - 专注C++开发菁英教育!( 陕ICP备2025058934号-1 )

版权所有 © 陕西菁英数字科技有限公司 2023-2026