<?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: Access-Control-Allow-Origin error while loading map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760799#M70526</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This error is usually due to the API's automatic detection of CORS support. The JSAPI attempts to access the rest endpoint of the service. If the service doesn't support CORS the request fails and the error you see is logged to the console. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In cases where CORS support is not available either due to lack of browser support for CORS or if the service you are making cross domain requests to does not support it you may need to setup a proxy for use by your application. Details on installing and configuring the proxy can be found here: &lt;A href="https://github.com/Esri/resource-proxy" title="https://github.com/Esri/resource-proxy"&gt;Esri/resource-proxy · GitHub&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 20 Aug 2014 23:48:23 GMT</pubDate>
    <dc:creator>KellyHutchins</dc:creator>
    <dc:date>2014-08-20T23:48:23Z</dc:date>
    <item>
      <title>Access-Control-Allow-Origin error while loading map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760796#M70523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I get following error while loading the map. I guess it's related to cross-domain. Is there any configuration that I need to set while creating map?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;XMLHttpRequest cannot load &amp;lt;server url&amp;gt;. Origin &amp;lt;local m/c name&amp;gt; is not allowed by Access-Control-Allow-Origin.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jun 2014 16:39:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760796#M70523</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-06-26T16:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Access-Control-Allow-Origin error while loading map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760797#M70524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could try adding the hostname of your server to the CORS enabled server array:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;require(["esri/config"], function(esriConfig) {
&amp;nbsp;&amp;nbsp; esriConfig.defaults.io.corsEnabledServers.push("yourhostname.com");
});
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your server's at 10.1 it should support this, otherwise you might need a proxy.&amp;nbsp; Check out this article:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/javascript/jshelp/ags_proxy.html" rel="nofollow noopener noreferrer" target="_blank"&gt;https://developers.arcgis.com/javascript/jshelp/ags_proxy.html&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:19:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760797#M70524</guid>
      <dc:creator>ScottGunn</dc:creator>
      <dc:date>2021-12-12T08:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Access-Control-Allow-Origin error while loading map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760798#M70525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Actually, I don't want to add proxy page, it would be bit hassle for my customers. I want to handle somehow for webserver configuration part dynamically or whenever I send request if I can change the header. Wondering if changing header with the request is possible through esr/request. I tried &lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f8f8f8;"&gt;esriConfig.defaults.io.corsEnabledServers&lt;/SPAN&gt; as you suggested but still gives an error. May be because of the restriction available at webserver level. Is there anything can be done at ArcGIS Server level to enable CORS? I am using ArcGIS Server 10.0.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 20:53:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760798#M70525</guid>
      <dc:creator>BhavinSanghani</dc:creator>
      <dc:date>2014-08-20T20:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Access-Control-Allow-Origin error while loading map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760799#M70526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This error is usually due to the API's automatic detection of CORS support. The JSAPI attempts to access the rest endpoint of the service. If the service doesn't support CORS the request fails and the error you see is logged to the console. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In cases where CORS support is not available either due to lack of browser support for CORS or if the service you are making cross domain requests to does not support it you may need to setup a proxy for use by your application. Details on installing and configuring the proxy can be found here: &lt;A href="https://github.com/Esri/resource-proxy" title="https://github.com/Esri/resource-proxy"&gt;Esri/resource-proxy · GitHub&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Aug 2014 23:48:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-control-allow-origin-error-while-loading/m-p/760799#M70526</guid>
      <dc:creator>KellyHutchins</dc:creator>
      <dc:date>2014-08-20T23:48:23Z</dc:date>
    </item>
  </channel>
</rss>

