我正在尝试将bootbox.js添加到测试页面。
目前,当我在触发引导框的超链接中包含 href 标记时,无论我单击哪个确认按钮(取消或确定),都会触发 href。
如何将 href 标签包含到 bootbox js 代码中,仅当用户选择 OK 确认选项时才会触发?我尝试了几次尝试,但都没有成功。
这是带有 href 标记的超链接:
<a id="id_customized_details_duplicate" href="{% url customized_details_duplicate customized_detail.id %}">Duplicate</a>
这是我的书箱 js 代码:
$(document).ready(function(){
$('#id_customized_details_duplicate').on('click', function(){
bootbox.confirm("Are you sure?", function(result) {
if (result) {
//include the href duplication link here?;
//showProgressAnimation();
alert('OK SELECTED');
} else {
alert('CANCEL SELECTED');
}
});
});
});