Created
September 11, 2012 08:57
-
-
Save otar/3697031 to your computer and use it in GitHub Desktop.
jQuery Confirmations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() | |
{ | |
$('a[rel="confirm"]').on('click', function(event) | |
{ | |
var message = !$(this).data('confirm') | |
? 'Are you sure you want to do this?' | |
: $(this).data('confirm'); | |
if (!confirm(message)) | |
{ | |
event.preventDefault(); | |
return false; | |
} | |
return true; | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment