const btn = document.getElementsByTagName('button')[0]; const result = document.querySelector('#result'); btn.addEventListener('click', function(){ const xhr = new XMLHttpRequest(); // IE缓存问题可以通过GET方式后附加Date时间戳来解决 xhr.open("GET",'http://127.0.0.1:8000/ie?t='+Date.now()); xhr.send(); xhr.onreadystatechange = function(){ if(xhr.readyState === 4){ if(xhr.status >= 200 && xhr.status< 300){ result.innerHTML = xhr.response; } } } })