function updatePopup(feature) { var deferred = new dojo.Deferred(); var url = sustainBase.url + "/" + feature.attributes.layerId + "/" + feature.attributes.OBJECTID + "/htmlPopup?f=json"; esri.request({ url: url, content: url.query, callbackParamName: "callback", load: function (response) { //esriServerHTMLPopupTypeAsURL deferred.callback("<iframe src='" + response.content + "' frameborder='0' width='100%' height='100%' style='width: 100%; height: 100%; display: block; padding: 0px; margin: 0px;'></iframe>"); }, error: function (error) { deferred.errback("Error occurred while generating profile"); } }); console.log(url); return deferred; return requestHandle; }