摘要: 一.回调地狱 在谈到回调地狱发生的情况和解决办法,需要先了解ajax请求 先列出服务器提供的数据接口: app.get('/data1', (req, res) => { res.send('hi') }) app.get('/data2', (req, res) => { res.send('he 阅读全文
posted @ 2021-01-18 22:20 zmztyas 阅读(263) 评论(0) 推荐(0) 编辑
摘要: ajax原生写法 一.get写法 //创建对象 let xhr = new XMLHttpRequest() xhr.open('get',"url?name=&age=") //查询字符串 xhr.send(null) 请求体 xhr.onreadystatechange = function() 阅读全文
posted @ 2021-01-18 16:14 zmztyas 阅读(131) 评论(0) 推荐(0) 编辑