<script>
xmlHttp = new XMLHttpRequest();
xmlHttp.open('post','xxx.PHP');
var name = 'zhangSan';
var age = 20;
var data = 'name=' + name + '&age=' + age;
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = function (){
//
};
<span style="white-space:pre"> </span>xmlHttp.send(data);
</script>
