<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>原文链接:https://www.f2er.com/ajax/164309.html