lib/loaders/LoaderBase.js
function () {
    if (this.loadTypeSet || this.loadType === LoaderBase.typeText) {
      this.content = this.xhr.response || this.xhr.responseText;
    } else {
      switch (this.loadType) {

        case LoaderBase.typeArraybuffer:

          if (ArrayBuffer) {
            this.content = stringToArrayBuffer(this.xhr.response);
          } else {
            throw new Error('This browser does not support ArrayBuffer');
          }
          break;

        case LoaderBase.typeBlob:
        case LoaderBase.typeVideo:
        case LoaderBase.typeAudio:

          if (Blob) {
            if (!this.fileMeta) {
              this.fileMeta = new FileMeta();
            }

            if (this.fileMeta.mime === null) {
              this.fileMeta.mime = getMimeFromURL(this.url);
            }

            this.content = new Blob([ stringToArrayBuffer(this.xhr.response) ], { type: this.fileMeta.mime });
          } else {
            throw new Error('This browser does not support Blob');
          }
          break;

        case LoaderBase.typeJSON:

          this.content = JSON.parse(this.xhr.response);
          break;

        case LoaderBase.typeDocument:

          // this needs some work pretty sure there's a better way to handle this
          this.content = this.xhr.response;
          break;

      }
    }
  }
function () {
    if (this.loadTypeSet || this.loadType === LoaderBase.typeText) {
      this.content = this.xhr.response || this.xhr.responseText;
    } else {
      switch (this.loadType) {

        case LoaderBase.typeArraybuffer:

          if (ArrayBuffer) {
            this.content = stringToArrayBuffer(this.xhr.response);
          } else {
            throw new Error('This browser does not support ArrayBuffer');
          }
          break;

        case LoaderBase.typeBlob:
        case LoaderBase.typeVideo:
        case LoaderBase.typeAudio:

          if (Blob) {
            if (!this.fileMeta) {
              this.fileMeta = new FileMeta();
            }

            if (this.fileMeta.mime === null) {
              this.fileMeta.mime = getMimeFromURL(this.url);
            }

            this.content = new Blob([ stringToArrayBuffer(this.xhr.response) ], { type: this.fileMeta.mime });
          } else {
            throw new Error('This browser does not support Blob');
          }
          break;

        case LoaderBase.typeJSON:

          this.content = JSON.parse(this.xhr.response);
          break;

        case LoaderBase.typeDocument:

          // this needs some work pretty sure there's a better way to handle this
          this.content = this.xhr.response;
          break;

      }
    }
  }
function ( ) { if ( this . loadTypeSet || this . loadType === LoaderBase . typeText ) { this . content = this . xhr . response || this . xhr . responseText ; } else { switch ( this . loadType ) { case LoaderBase . typeArraybuffer : if ( ArrayBuffer ) { this . content = stringToArrayBuffer ( this . xhr . response ) ; } else { throw new Error ( 'This browser does not support ArrayBuffer' ) ; } break ; case LoaderBase . typeBlob : case LoaderBase . typeVideo : case LoaderBase . typeAudio : if ( Blob ) { if ( ! this . fileMeta ) { this . fileMeta = new FileMeta ( ) ; } if ( this . fileMeta . mime === null ) { this . fileMeta . mime = getMimeFromURL ( this . url ) ; } this . content = new Blob ( [ stringToArrayBuffer ( this . xhr . response ) ] , { type : this . fileMeta . mime } ) ; } else { throw new Error ( 'This browser does not support Blob' ) ; } break ; case LoaderBase . typeJSON : this . content = JSON . parse ( this . xhr . response ) ; break ; case LoaderBase . typeDocument : // this needs some work pretty sure there's a better way to handle this this . content = this . xhr . response ; break ; } } }
This function will grab the response from the content loaded and parse it out

@method _parseContent
@protected
This function will grab the response from the content loaded and parse it out