开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜