lib/loaders/LoaderBase.js
function (url) {
    this.url = url;

    if (this.canLoadUsingXHR()) {
      this.xhr = new XMLHttpRequest();
      this.xhr.open('GET', url, true);

      this.xhr.onreadystatechange = this._onStateChange;
      this.xhr.onprogress !== undefined && (this.xhr.onprogress = this._onProgress);

      if (this.loadType !== LoaderBase.typeText) {
        if (!checkIfGoodValue.call(this)) {
          console.warn('Attempting to use incompatible load type ' + this.loadType + '. Switching it to ' + LoaderBase.typeText);
          this.loadType = LoaderBase.typeText;
        }

        try {
          this.loadTypeSet = checkResponseTypeSupport.call(this) && checkAndSetType(this.xhr, this.loadType);
        } catch (e) {
          this.loadTypeSet = false;
        }

        if (!this.loadTypeSet && (this.loadType === LoaderBase.typeBlob || this.loadType === LoaderBase.typeArraybuffer)) {
          this.xhr.overrideMimeType('text/plain; charset=x-user-defined');
        }
      }

      this.xhr.send();
    }
  }
function (url) {
    this.url = url;

    if (this.canLoadUsingXHR()) {
      this.xhr = new XMLHttpRequest();
      this.xhr.open('GET', url, true);

      this.xhr.onreadystatechange = this._onStateChange;
      this.xhr.onprogress !== undefined && (this.xhr.onprogress = this._onProgress);

      if (this.loadType !== LoaderBase.typeText) {
        if (!checkIfGoodValue.call(this)) {
          console.warn('Attempting to use incompatible load type ' + this.loadType + '. Switching it to ' + LoaderBase.typeText);
          this.loadType = LoaderBase.typeText;
        }

        try {
          this.loadTypeSet = checkResponseTypeSupport.call(this) && checkAndSetType(this.xhr, this.loadType);
        } catch (e) {
          this.loadTypeSet = false;
        }

        if (!this.loadTypeSet && (this.loadType === LoaderBase.typeBlob || this.loadType === LoaderBase.typeArraybuffer)) {
          this.xhr.overrideMimeType('text/plain; charset=x-user-defined');
        }
      }

      this.xhr.send();
    }
  }
function ( url ) { this . url = url ; if ( this . canLoadUsingXHR ( ) ) { this . xhr = new XMLHttpRequest ( ) ; this . xhr . open ( 'GET' , url , true ) ; this . xhr . onreadystatechange = this . _onStateChange ; this . xhr . onprogress !== undefined && ( this . xhr . onprogress = this . _onProgress ) ; if ( this . loadType !== LoaderBase . typeText ) { if ( ! checkIfGoodValue . call ( this ) ) { console . warn ( 'Attempting to use incompatible load type ' + this . loadType + '. Switching it to ' + LoaderBase . typeText ) ; this . loadType = LoaderBase . typeText ; } try { this . loadTypeSet = checkResponseTypeSupport . call ( this ) && checkAndSetType ( this . xhr , this . loadType ) ; } catch ( e ) { this . loadTypeSet = false ; } if ( ! this . loadTypeSet && ( this . loadType === LoaderBase . typeBlob || this . loadType === LoaderBase . typeArraybuffer ) ) { this . xhr . overrideMimeType ( 'text/plain; charset=x-user-defined' ) ; } } this . xhr . send ( ) ; } }
The load function should be called to start preloading data.


The first parameter passed to the load function is the url to the data to be loaded.
It should be noted that mimetype for binary Blob data is read from
the file extension. EG. jpg will use the mimetype "image/jpeg".


@method load
@param  {String} url This is the url to the data to be loaded
The load function should be called to start preloading data .