The problem is as soon this server is on https, and we are not getting proper response
This is the type of response that we get from the server, when we do
featureLayer.selectFeatures();
The resource from this URL is not text: https://<server-name>/rest/services/grid/MapServer/0/query?f=json&where=NAME%20%3D%20%27AGR1%27%20AND%20SUBGRID_PRESENT%20%3D%20%27NO%27&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=NAME%2CGRID_NUMBER%2CCOUNT%2COBJECTID&callback=esriDojo.io.script.jsonp_esriDojoIoScript4._jsonpCallback