美文网首页
ajax 四部曲

ajax 四部曲

作者: Spidd | 来源:发表于2020-03-17 18:03 被阅读0次

    let xhr = new XMLHttpRequest(); //1.创建创建XMLHttpRequest对象

    xhr.open('GET','/user',true); //2.连接服务器

    xhr.send(); // 3.发送请求

    xhr.onload = function(){ // 4.接收数据
    console.log(xhr.response);
    }

    相关文章

      网友评论

          本文标题:ajax 四部曲

          本文链接:https://www.haomeiwen.com/subject/lqcxyhtx.html