<body>
<h1>发送get请求并且发送参数</h1>
<script>
//1.创建对象
var xhr=new XMLHttpRequest();
//2.指定服务器地址
xhr.open('GET','http://127.0.0.1:3000/get3?name=riverrun',true);
//3.发送
xhr.send();
//4.接收服务器 cxlget3 ok
setTimeout(function(){
console.log(xhr.responseText);
},1000);
</script>
</body>
结果