Skip to content

Instantly share code, notes, and snippets.

@lnramirez
Created February 4, 2013 17:57
Show Gist options
  • Save lnramirez/4708337 to your computer and use it in GitHub Desktop.
Save lnramirez/4708337 to your computer and use it in GitHub Desktop.
if (confirm("Are you sure you want to delete this image?")) {
require(["dojo/json","dojo/request/xhr","dojo/query","dojo/dom-construct"],
function(json,xhr,query,domConstruct) {
xhr.del("${pageContext.request.contextPath}/images/delete/" + id_,{headers: {"Content-Type": "application/json"}}).
then(function(response) {
var node = query("div#" + id_)[0];
if (node != 'undefined') {
node.parentNode.removeChild(node);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment