Skip to content

Instantly share code, notes, and snippets.

@austra
Created February 11, 2015 20:10
Show Gist options
  • Save austra/868e06718c00ffee70d2 to your computer and use it in GitHub Desktop.
Save austra/868e06718c00ffee70d2 to your computer and use it in GitHub Desktop.
confimation before ajax request
$('.removeItem').click(function (event) {
if (confirm('Are you sure you want to delete this?')) {
$.ajax({
url: 'myUrl',
type: "POST",
data: {
// data stuff here
},
success: function () {
// does some stuff here...
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment