Hello,
I am trying to execute a query from a custom widget that I wrote.
Code:
var qt = new QueryTask('http://[url]/MapServer/0');
var q = new Query();
q.spatialRelationship = esri.tasks.Query.SPATIAL_REL_INTERSECTS;
q.outSpatialReference = { wkid: 102100 };
q.returnGeometry = true;
q.outFields = ["*"];
q.geometry = this.geometry; // I know this is a polygon
qt.execute(q, function(resultList) { /* do stuff here */ }, function(err){ /* catch error */});
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.
My proxies are in place and everything seems to be ok on that side.
Has anyone experienced this behavior before? Any tips are appreciated.
Thanks.
Solved! Go to Solution.
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.
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.