If you cancel the XHR, the error callback will be triggered, think about it if you handle errors with a �??try again�?� mechanism, since you may reschedule a canceled request
if( typeof esri.layers.Layer.prototype._errorHandler == 'function' ) { esri.layers.Layer.prototype._errorHandler = function(error) { if( error && error.message && error.message == "xhr cancelled" ) return; this.onError(error); } dojo.config.deferredOnError = function(e){} dojo._ioSetArgs2 = dojo._ioSetArgs; dojo._ioSetArgs = function(_14,_15,_16,_17) { return dojo._ioSetArgs2(_14,_15,_16,function(a,b){return a;}); } }
Can you advise where to add this code?
This is a "hack" in the API, so I cannot guarantee that this is still compatible with latest version of the API.
You should place this in your javascript as soon as possible after once the esri.layers package is loaded.
Regards,
Thanks Simon, it works. I'm still using the 3.12 API version. Inserted it at the start of my "require" first function.
Thanks Simon,
3 years later ... this still works !