<!DOCTYPE HTML>
<html>
<body>

Makes XHR request every 50ms. Watch the memory. Fixes XHR leak in older IEs.

<script>
onload = function() {
  setInterval(function(){
     var xhr = new XMLHttpRequest()
     xhr.open('GET', 'jquery.js', true)
     xhr.onreadystatechange = function() {
        if(this.readyState == 4 && this.status == 200) {            
           document.getElementById('test').innerHTML++
        }
     }
     xhr.send(null)
     xhr = null
  }, 50)
}
</script>
<div >0</div>

</body>
</html>

 

相关文章:

  • 2021-08-10
猜你喜欢
  • 2022-12-23
  • 2018-03-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-03
  • 2021-08-07
  • 2021-11-25
相关资源
相似解决方案