ajax异步请求是指客户端和服务端无刷新的请求交互技术。
var xhr = new XMLHttpRedueft//请求
xhr.onreadystatechange = fn
xhr.open( ‘请求方式get/post’,'请求地址' )
xhr.send(’get时ntll,post是数据‘)
function fn(
if(xhr.readystate==4 && xhr.status==200){
alert(xhr,responseText)
}
}
ajax异步请求是指客户端和服务端无刷新的请求交互技术。
var xhr = new XMLHttpRedueft//请求
xhr.onreadystatechange = fn
xhr.open( ‘请求方式get/post’,'请求地址' )
xhr.send(’get时ntll,post是数据‘)
function fn(
if(xhr.readystate==4 && xhr.status==200){
alert(xhr,responseText)
}
}