Ajax的学习
1.ajax asynchronous javascript and xml (异步的javascript和xml)
2.请求代码的流程
var xmlHttp = new XMLHttpRequest();
if(xmlHttp!=null){
xmlHttp.onreadystatechanage = function(){
if(xmlHttp.readyState == 4 && xmlHttp.status == 200) //4请求成功 200成功返回数据
var resultObj = eval("("+xmlHttp.responseText+")");//JSON化返回数据
}
xmlHttp.open("GET","http://****",true);//设置请求类型,路径及方式
xmlHttp.send();//发送请求
}