1.调用函数
2.定义xmlhttp=new XMLHttpRequest();
3.储存函数xmlhttp.onreadystatechange=function()
{ if(xml.readyState==4) //如果已准备完成
document.write("哈哈")} //做出下列反应
4.xmlhttp.open('','',) //xmlhttp.open("GET","test1.txt",true);
xmlhttp.send() //POST时括号内加string即添加的信息
XMLHttpRequest是内建对象,作用:后台与服务器交换数据,用法见上
open(method,url,async) 规定请求的类型、URL 以及是否异步处理请求。
method:请求的类型;GET 或 POST
url:文件在服务器上的位置 后面可以添加信息用?表示
async:true(异步)或 false(同步)
2.定义xmlhttp=new XMLHttpRequest();
3.储存函数xmlhttp.onreadystatechange=function()
{ if(xml.readyState==4) //如果已准备完成
document.write("哈哈")} //做出下列反应
4.xmlhttp.open('','',) //xmlhttp.open("GET","test1.txt",true);
xmlhttp.send() //POST时括号内加string即添加的信息
XMLHttpRequest是内建对象,作用:后台与服务器交换数据,用法见上
open(method,url,async) 规定请求的类型、URL 以及是否异步处理请求。
method:请求的类型;GET 或 POST
url:文件在服务器上的位置 后面可以添加信息用?表示
async:true(异步)或 false(同步)