开发者

jQuery confirm dialog - pause until approved

开发者 https://www.devze.com 2023-01-25 15:31 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消