1)创建Ajax对象
var xhr=new XMLHttpRequest();
2)open(method,url,async) 告诉服务器请求方法和请求地址
method:get/post
url:地址
async:是否异步
xhr.open('get','http://www.example.com')
3)xhr.send(string) 发送请求
xhr.send()
4)获取服务器端给与客户端的响应数据
xhr.onload=function(){
console.log(xhr.responseText)
}