AJAX-get和post传参
GET传参
<script>
var xml = new XMLHttpRequest();
xml.onreadystatechange = function(){
if(xml.readyState == 200){
if(xml.status == 4){
console.log('success');
}
}
}
xml.open('GET','http://jsonplaceholder.typicode.com/posts/1',true);
xml.send();
</script>
POST传参
<script>
var xml = new XMLHttpRequest();
xml.onreadystatechange = function(){
if(xml.readyState == 200){
if(xml.status == 4){
console.log('success');
}
}
}
xml.open('POST','http: