首先我创建了一个helloajax.txt的文本,我准备在a链接里面实现不刷新更新链接的内容
<html>
<head><title></title>
<meta charset="utf-8">
<script type="text/javascript">
window.onload = function(){
var a = document.getElementById("a");
a.addEventListener("click",function(e){
//1.获取 a 节点,并且为其添加onclic事件
//2.取消a节点的默认行为
//3.创建一个XMLHttpRequest对象
var request = new XMLHttpRequest();
//4.准备发送请求的url
var url = "helloajax.txt";
var method = "GET";
request.open(method,url);
request.send(null);
request.on