title: How to set up ajax time out in javascript?
body: <p>Below is the snippet of my code that I am using. Actually video that I am loading is of about 1GB, so incase user has medium internet connection, the ajax times out the request, before the video gets fully loaded.</p>
  
  <p>Hence I want to reset ajax time out period to 1 day, so that it doesn't gets timed out.</p>
  
  <pre><code>$(window).load(function(){
      console.log("Downloading video...hellip;Please wait...");
      var xhr = new XMLHttpRequest();
      xhr.open('GET', 'video/video.m4v', true);
      xhr.responseType = 'blob';
      xhr.onload = function(e) {
        if (this.status == 200) {
          console.log("got it");
          var myBlob = this.response;
          var vid = (window.webkitURL ? webkitURL : URL).createObjectURL(myBlob);
          // myBlob is now the blob that the objec8t URL pointed to.
          var video = document.getElementById("video");
          console.log("Loading video into element");
          video.src = vid;
          // not needed if autoplay is set for the video element
          // video.play()
              //alert(1);
              windowLoad();
              $('body').removeClass('loading');
         }
    }
  xhr.send();
  });
  </code></pre>
  
  <p>Thanks</p>