基本步骤:
var xhr =null;//创建对象
if(window. XMLHttpRequest) {
xhr = new XMLHttpRequest();
}else{
xhr = new ActiveXObject ("Microsoft. XMLHTTP");
}
xhr. open( “方式”,”地址”,”标志位”);//初始化请求
xhr. setRequestHeader ("”,” ”); 〃设置 http 头信息
xhr. onreadystatechange =function() {}//指定回调函数
xhr. send ();//发送请求

Was this helpful?

0 / 0

发表回复 0

Your email address will not be published.