Skip to content

Instantly share code, notes, and snippets.

@72lions
Created January 14, 2013 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 72lions/4528745 to your computer and use it in GitHub Desktop.
Save 72lions/4528745 to your computer and use it in GitHub Desktop.
Loading a binary data with the HXMLHttpRequest object
/**
* It is responsible for loading all the different chunks
*
* @private
* @type {XMLHttpRequest}
*/
var _request = new XMLHttpRequest();
// Set the responseType to arraybuffer
_request.responseType = 'arraybuffer';
_request.addEventListener('load', _onChunkLoaded, false);
_request.open('GET', 'chunks/' + _files[index], true);
_request.send();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment