<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Firefox Firebug Error: XHR Cancelled in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553711#M51661</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A bit late but it may be useful for other people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a solution to get rid of "xhr cancelled" messages :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if( typeof esri.layers.Layer.prototype._errorHandler == 'function' )
 {
&amp;nbsp; esri.layers.Layer.prototype._errorHandler = function(error)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if( error &amp;amp;&amp;amp; error.message &amp;amp;&amp;amp; error.message == "xhr cancelled" )
&amp;nbsp;&amp;nbsp;&amp;nbsp; return;
&amp;nbsp;&amp;nbsp; this.onError(error);
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; dojo.config.deferredOnError = function(e){}
&amp;nbsp; dojo._ioSetArgs2 = dojo._ioSetArgs;
&amp;nbsp; dojo._ioSetArgs = function(_14,_15,_16,_17)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return dojo._ioSetArgs2(_14,_15,_16,function(a,b){return a;});
&amp;nbsp; }
 }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 23:55:55 GMT</pubDate>
    <dc:creator>SimonUyttendaele</dc:creator>
    <dc:date>2021-12-11T23:55:55Z</dc:date>
    <item>
      <title>Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553706#M51656</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Javascript API 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I created a layer and a renderer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After I add the layer to the map . . .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;map.addLayer(myLayer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;. . . I generate the renderer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;generateRenderer.execute(params, ftnApplyRenderer, ftnErrorHandler);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Everything works fine, but I get an 'xhr cancelled' error in Firebug (Firefox 17.0) in the function below when refresh() is called on the layer:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;function ftnApplyRenderer(renderer) {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'use strict';&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; myLayer.setRenderer(renderer);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;STRONG&gt;myLayer.refresh();&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I comment out the refresh() part, the error goes away, but then the layer doesn't render.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I clear the error console and run the above function again, the error does not occur. It seems that when the layer is added, dojo is still doing something that gets cancelled when the refresh() method is called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even though the application still works fine, how can I avoid this error?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 15:48:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553706#M51656</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2012-12-12T15:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553707#M51657</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am seeing similar. When i have refresh i get those errors but when i don't it seems like the layer is a click behind. I'm using a feature layer with a tooltip on hover and i'm hiding and showing the layer and then trying to force a refresh.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't have an answer, sorry, i think it is related to the timing of when the layer is interacted with.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 17:46:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553707#M51657</guid>
      <dc:creator>KeG</dc:creator>
      <dc:date>2012-12-12T17:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553708#M51658</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;As suspected, this is a timing issue . . .&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I put refresh() inside a timeout, the error goes away:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;setTimeout('myLayer.refresh();', 1000);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This, however, is not a real solution.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been looking into the dojo &lt;/SPAN&gt;&lt;STRONG&gt;deferred &lt;/STRONG&gt;&lt;SPAN&gt; examples, but . . . I'm totally new to JSAPI and dojo, and not sure if that is the right way to go.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Help appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Dan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Dec 2012 19:56:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553708#M51658</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2012-12-12T19:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553709#M51659</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;For a live example of a similar error, please visit the ESRI JSAPI sample at the link below:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/samples/renderer_generate_renderer/index.html" rel="nofollow"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/samples/renderer_generate_renderer/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(NOTE: The error is intermittent so you may need to load the page a few times and select from the drop-down list a few times before the error presents itself.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Click image below to see the '&lt;/SPAN&gt;&lt;SPAN style="color:&amp;quot;#FF0000&amp;quot;;"&gt;Unable to draw graphic (null)&lt;/SPAN&gt;&lt;SPAN&gt;' error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]19998[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Dec 2012 13:37:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553709#M51659</guid>
      <dc:creator>Dan</dc:creator>
      <dc:date>2012-12-17T13:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553710#M51660</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This error message (xhr cancelled) is a "feature" from Dojo :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dojotoolkit.org/reference-guide/1.9/dojo/xhrGet.html"&gt;http://dojotoolkit.org/reference-guide/1.9/dojo/xhrGet.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;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&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When you move the map around, or call a refresh, sometimes, pending requests are cancelled by the API because they are already outdated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thus, Dojo triggers the "onError" event.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To my opinion, this should be caught by the API and not forwarded to the layer's "onError" callback...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Jul 2013 08:35:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553710#M51660</guid>
      <dc:creator>SimonUyttendaele</dc:creator>
      <dc:date>2013-07-24T08:35:32Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553711#M51661</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;A bit late but it may be useful for other people.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is a solution to get rid of "xhr cancelled" messages :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt; if( typeof esri.layers.Layer.prototype._errorHandler == 'function' )
 {
&amp;nbsp; esri.layers.Layer.prototype._errorHandler = function(error)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; if( error &amp;amp;&amp;amp; error.message &amp;amp;&amp;amp; error.message == "xhr cancelled" )
&amp;nbsp;&amp;nbsp;&amp;nbsp; return;
&amp;nbsp;&amp;nbsp; this.onError(error);
&amp;nbsp; }
&amp;nbsp; 
&amp;nbsp; dojo.config.deferredOnError = function(e){}
&amp;nbsp; dojo._ioSetArgs2 = dojo._ioSetArgs;
&amp;nbsp; dojo._ioSetArgs = function(_14,_15,_16,_17)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp; return dojo._ioSetArgs2(_14,_15,_16,function(a,b){return a;});
&amp;nbsp; }
 }&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:55:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553711#M51661</guid>
      <dc:creator>SimonUyttendaele</dc:creator>
      <dc:date>2021-12-11T23:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553712#M51662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/6976"&gt;Simon Uyttendaele&lt;/A&gt;​&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you advise where to add this code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 12:50:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553712#M51662</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2015-03-17T12:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553713#M51663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is a "hack" in the API, so I cannot guarantee that this is still compatible with latest version of the API.&lt;/P&gt;&lt;P&gt;You should place this in your javascript as soon as possible after once the esri.layers package is loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 20:53:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553713#M51663</guid>
      <dc:creator>simonuyttendaele1</dc:creator>
      <dc:date>2015-03-17T20:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553714#M51664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Simon, it works.&amp;nbsp; I'm still using the 3.12 API version.&amp;nbsp; Inserted it at the start of my "require" first function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 05:57:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553714#M51664</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2015-03-18T05:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: Firefox Firebug Error: XHR Cancelled</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553715#M51665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Simon,&lt;/P&gt;&lt;P&gt;3 years later ... this still works !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 29 Jan 2017 23:49:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/firefox-firebug-error-xhr-cancelled/m-p/553715#M51665</guid>
      <dc:creator>Rolandvan_Zoest</dc:creator>
      <dc:date>2017-01-29T23:49:03Z</dc:date>
    </item>
  </channel>
</rss>

