jQuery confirm dialog - pause until approved
The following code works on buttons and other things that have no default ac开发者_JAVA技巧tion, but on a <a href='URL'>
it doesn't wait for the confirm dialog... any thoughts on how I should accomplish this without breaking the pre-existing functionality?
jQuery('.confirm').bind('click', function (e) {
jConfirm(jQuery(e.target).attr('rel'), 'Confirm', function (r) {
if (r === false) {
e.preventDefault();
}
});
});
You should replace the URL on the anchor and have your confirmation do the actual redirect to the "success" page.
You need something like <a href="javascript:openMyDialog();" >Confirm</a>
instead of the actual url you have now.
精彩评论