#ajax5个步骤
//(1).实例化ajax对象
let xhr = new XMLHttpRequest()
//(2).设置请求方法和地址
xhr.open(“post”, “https://autumnfish.cn/api/user/register”)
//(3).设置请求头(post请求才需要设置)
xhr.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”)
//(4).发送请求 : 参数格式 ‘key=value’
xhr.send(“username=admin”)
//(5).注册回调函数
xhr.onload = function() {
console.log(xhr.responseText)
}
#深拷贝




Ajax步骤与深拷贝相关内容
博客介绍了ajax的5个步骤,包括实例化ajax对象、设置请求方法和地址、设置请求头、发送请求以及注册回调函数,还提及了深拷贝,但未给出深拷贝具体内容,主要围绕前端技术展开。
171万+

被折叠的 条评论
为什么被折叠?



