当我点击a
链接时,我想显示确认消息,但它会立即消失。代码是:
$(document).ready(function(){
$('#deleteButton').click(function () {
bootbox.confirm("Are you sure?", function (result) {
return result;
});
});
});
我在html代码中使用struts标记:
<s:a action="delete" id="deleteButton">
答案 0 :(得分:2)
尝试以下代码
$('#deleteButton').click(function (e) {
e.preventDefault();
bootbox.confirm("Are you sure?", function (result) {
if(result)
{
window.location = "YOUR URL";
}
});
});