Sorry to resurrect the thread, but I've encountered this also.Did you find a resolution to this? I'll probably put a support call in too, but it'd be handy to have the solution in the public domain once it's found - there are quite a few threads on the subject.The observed behaviour differs according to whether you're using the ArcGISDynamicMapServiceLayer or the FeatureLayer class. Basically, the former fails with the above described error, and the latter works, as in the above example. Both are fine in Firefox, just not IE.The code below illustrates this, pop it into the above example supplied by Derek:
dojo.require("dijit.layout.BorderContainer");
dojo.require("dijit.layout.ContentPane");
dojo.require("dijit.layout.AccordionContainer");
dojo.require("esri.map");
dojo.require("esri.dijit.Legend");
dojo.require("esri.arcgis.utils");
dojo.require("dijit.form.CheckBox");
dojo.require("esri.IdentityManager");
var map;
var legendLayers = [];
function init() {
esri.config.defaults.io.proxyUrl = "proxy/proxy.ashx";
map = new esri.Map("map", {
extent: new esri.geometry.Extent({"xmin":-12034010,"ymin":4487877,"xmax":-11965751,"ymax":4525561,"spatialReference":{"wkid":3857}})
});
//Add the terrain service to the map. View the ArcGIS Online site for services http://arcgisonline/home/search.html?t=content&f=typekeywords:service
var basemap = new esri.layers.ArcGISTiledMapServiceLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer");
map.addLayer(basemap);
var trailsService = new esri.layers.ArcGISDynamicMapServiceLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/Trails/MapServer", {
id: "Trails"
});
/**
// This will work.
var conditions = new esri.layers.FeatureLayer("https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/FeatureServer/0",{
id: "Conditions",
mode: esri.layers.FeatureLayer.MODE_ONDEMAND,
outFields: ["*"]
});
**/
// This will fail.
var layerURL = "https://servicesbeta.esri.com/ArcGIS/rest/services/SanJuan/TrailConditions/MapServer";
var conditions = new esri.layers.ArcGISDynamicMapServiceLayer(layerURL);
legendLayers.push({ layer: trailsService, title: 'Trails' });
legendLayers.push({ layer: conditions, title: 'Conditions' });
dojo.connect(map,'onLayersAddResult',function(results){
console.log("layers add result: ", results, legendLayers);
var legend = new esri.dijit.Legend({
map: map,
layerInfos: legendLayers
},"legendDiv");
legend.startup();
});
map.addLayers([trailsService, conditions]);
dojo.connect(map, 'onLayersAddResult', function(results) {
//add check boxes
dojo.forEach(legendLayers, function(layer){
var layerName = layer.title;
var checkBox = new dijit.form.CheckBox({
name: "checkBox" + layer.layer.id,
value: layer.layer.id,
checked: layer.layer.visible,
onChange: function(evt) {
var clayer = map.getLayer(this.value);
clayer.setVisibility(!clayer.visible);
this.checked = clayer.visible;
}
});
//add the check box and label to the toc
dojo.place(checkBox.domNode,dojo.byId("toggle"),"after");
var checkLabel = dojo.create('label',{'for':checkBox.name, innerHTML:layerName},checkBox.domNode,"after");
dojo.place("<br />",checkLabel,"after");
});
});
dojo.connect(map, 'onLoad', function(theMap) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
}
dojo.addOnLoad(init);
Just for the record, it displays the same symptoms using api 2.6 and non-https services.Cheers, Ben.