标签:cat url orm head var xmlhttp post function type
get:
var ajax=new XMLHttpRequest();
ajax.open(‘get‘,‘__URL__/check_all?val=‘+check);
ajax.send();
ajax.onreadystatechange=function(){
if(ajax.readyState==4&&ajax.status==200){
ajax.responseText;
}
}
post:
var ajax=new XMLHttpRequest();
ajax.open(‘get‘,‘__URL__/check_all?val=‘+check);
ajax.setRequestHeader(‘content-type‘,‘application/x-www-form-urlencoded‘)
ajax.send();
ajax.onreadystatechange=function(){
if(ajax.readyState==4&&ajax.status==200){
ajax.responseText;
}
}
标签:cat url orm head var xmlhttp post function type
原文地址:http://www.cnblogs.com/ymk0375/p/6257724.html