<?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 Access Is Denied in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-is-denied/m-p/762929#M70671</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to execute a query from a custom widget that I wrote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14121997312101229" jivemacro_uid="_14121997312101229" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN&gt;var qt = new QueryTask('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://[url]/MapServer/0');" rel="nofollow" target="_blank"&gt;http://[url]/MapServer/0');&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;var q = new Query();&lt;/P&gt;
&lt;P&gt;q.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;&lt;/P&gt;
&lt;P&gt;q.outSpatialReference = { wkid: 102100 };&lt;/P&gt;
&lt;P&gt;q.returnGeometry = true;&lt;/P&gt;
&lt;P&gt;q.outFields = ["*"];&lt;/P&gt;
&lt;P&gt;q.geometry = this.geometry; // I know this is a polygon&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;qt.execute(q, function(resultList) { /* do stuff here */ }, function(err){ /* catch error */});&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this code from a widget using IE 9, I get an Access Is Denied error in /* catch error */. If I run this code from outside the widget in IE9 it seems to work fine. If I run this code from IE 11 or Firefox, it works regardless of whether or not it is in a dijit widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My proxies are in place and everything seems to be ok on that side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone experienced this behavior before? Any tips are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2014 21:45:37 GMT</pubDate>
    <dc:creator>AlexeiB</dc:creator>
    <dc:date>2014-10-01T21:45:37Z</dc:date>
    <item>
      <title>Access Is Denied</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-is-denied/m-p/762929#M70671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to execute a query from a custom widget that I wrote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14121997312101229" jivemacro_uid="_14121997312101229" modifiedtitle="true"&gt;
&lt;P&gt;&lt;SPAN&gt;var qt = new QueryTask('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://[url]/MapServer/0');" rel="nofollow" target="_blank"&gt;http://[url]/MapServer/0');&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;var q = new Query();&lt;/P&gt;
&lt;P&gt;q.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;&lt;/P&gt;
&lt;P&gt;q.outSpatialReference = { wkid: 102100 };&lt;/P&gt;
&lt;P&gt;q.returnGeometry = true;&lt;/P&gt;
&lt;P&gt;q.outFields = ["*"];&lt;/P&gt;
&lt;P&gt;q.geometry = this.geometry; // I know this is a polygon&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;qt.execute(q, function(resultList) { /* do stuff here */ }, function(err){ /* catch error */});&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run this code from a widget using IE 9, I get an Access Is Denied error in /* catch error */. If I run this code from outside the widget in IE9 it seems to work fine. If I run this code from IE 11 or Firefox, it works regardless of whether or not it is in a dijit widget.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My proxies are in place and everything seems to be ok on that side.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone experienced this behavior before? Any tips are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 21:45:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-is-denied/m-p/762929#M70671</guid>
      <dc:creator>AlexeiB</dc:creator>
      <dc:date>2014-10-01T21:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Access Is Denied</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-is-denied/m-p/762930#M70672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It appears I have solved it! The issue was the proxy. I had established a proxy on my live site which I was using from my development machine. This works well if I access the site from the live URL. But if I used the proxy from my local machine using IE9 I was getting that error. I resolved the problem by copying the proxy to my local IIS on my machine and set a relative proxy URL vs the absolute I had before in my code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Oct 2014 15:21:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/access-is-denied/m-p/762930#M70672</guid>
      <dc:creator>AlexeiB</dc:creator>
      <dc:date>2014-10-07T15:21:28Z</dc:date>
    </item>
  </channel>
</rss>

