11/**
22 * @license
3- * pixi.js - v2.1.5
3+ * pixi.js - v2.1.6
44 * Copyright (c) 2012-2014, Mat Groves
55 * http://goodboydigital.com/
66 *
7- * Compiled: 2015-01-22
7+ * Compiled: 2015-02-04
88 *
99 * pixi.js is licensed under the MIT License.
1010 * http://www.opensource.org/licenses/mit-license.php
@@ -17227,19 +17227,7 @@ PIXI.EventTarget.mixin(PIXI.JsonLoader.prototype);
1722717227 */
1722817228PIXI.JsonLoader.prototype.load = function()
1722917229{
17230- if(window.XDomainRequest && this.crossorigin)
17231- this.ajaxRequest = new window.XDomainRequest();
17232- else
17233- this.ajaxRequest = new PIXI.AjaxRequest();
17234- this.ajaxRequest.onload = this.ajaxRequest.onreadystatechange = this.onJSONLoaded.bind(this);
17235-
17236- var src = PIXI.buildPath(this.url, this.baseUrl);
17237- // XDomainRequest has a few quirks. Occasionally it will abort requests
17238- this.ajaxRequest.open('GET', src, true);
17239- if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
17240- // Determine the XHR level
17241- var xhrLevel = (typeof this.ajaxRequest.responseType === 'string') ? 2 : 1;
17242- //attempt to only use cross domain requests if needed, because IE9 - code borrowed from PreloadJS
17230+ //attempt to only use cross domain requests if needed, because IE9 - code borrowed from PreloadJS
1724317231 var crossDomain = false;
1724417232 if(this.crossorigin)
1724517233 {
@@ -17252,6 +17240,19 @@ PIXI.JsonLoader.prototype.load = function()
1725217240 target.protocol !== host.protocol ||
1725317241 target.hostname !== host.hostname);
1725417242 }
17243+ if(window.XDomainRequest && crossDomain)
17244+ this.ajaxRequest = new window.XDomainRequest();
17245+ else
17246+ this.ajaxRequest = new PIXI.AjaxRequest();
17247+ this.ajaxRequest.onload = this.ajaxRequest.onreadystatechange = this.onJSONLoaded.bind(this);
17248+
17249+ var src = PIXI.buildPath(this.url, this.baseUrl);
17250+ // XDomainRequest has a few quirks. Occasionally it will abort requests
17251+ this.ajaxRequest.open('GET', src, true);
17252+ if (this.ajaxRequest.overrideMimeType) this.ajaxRequest.overrideMimeType('application/json');
17253+ // Determine the XHR level
17254+ var xhrLevel = (typeof this.ajaxRequest.responseType === 'string') ? 2 : 1;
17255+ //make sure of the request header
1725517256 if (crossDomain && this.ajaxRequest instanceof XMLHttpRequest && xhrLevel === 1) {
1725617257 this.ajaxRequest.setRequestHeader('Origin', location.origin);
1725717258 }
@@ -17261,6 +17262,7 @@ PIXI.JsonLoader.prototype.load = function()
1726117262 clearTimeout(this._loadTimeout);
1726217263 this._loadTimeout = 0;
1726317264 }
17265+ this._loadFails = 0;
1726417266 var scope = this;
1726517267 this.ajaxRequest.onloadstart = function(){};
1726617268 this.ajaxRequest.onprogress = function(){};
0 commit comments