Skip to content

Instantly share code, notes, and snippets.

@jjgonecrypto
Created January 23, 2012 21:38
Show Gist options
  • Save jjgonecrypto/1665658 to your computer and use it in GitHub Desktop.
Save jjgonecrypto/1665658 to your computer and use it in GitHub Desktop.
this.browser.clickLink(link, function(e, b, s) {
b.onconfirm(function(q){ return true; });
callback(e,b,s);
});
$('.destroy').bind('click', function(e) {
e.preventDefault();
if (confirm('Are you sure you want to delete this item?')) {
var element = $(this),
form = $('<form></form>');
form
.attr({
method: 'POST',
action: element.attr('href')
})
.hide()
.append('<input type="hidden" />')
.find('input')
.attr({
'name': '_method',
'value': 'delete'
})
.end()
.submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment