ajax小结

1.创建对象

XMLHttpRequest 用于在后台与服务器交换数据。这意味着可以在不重新加载整个网页的情况下,对网页的某部分进行更新。

const xmlhttp=new XMLHttpRequest()

2.向服务器发送请求

xmlhttp.open(method,url,async);

xmlhttp.send();

3.服务器响应请求并返回相应信息

XMLHttpRequest.reponseText或者XMLHttpRequest.responseXML

4.readyState和onreadystatechange事件

ajax小结_第1张图片

你可能感兴趣的:(ajax小结)