我有这样的链接。
<a href="delete.php?id=1" class="delete">Delete</a>
如果用户点击它。应弹出确认,然后仅当用户单击“是”时,它才应转到实际 URL。
我知道这可以防止默认行为
function show_confirm()
{
var r=confirm("Are you sure you want to delete?");
if (r==true) { **//what to do here?!!** }
}
$('.delete').click(function(event) {
event.preventDefault();
show_confirm()
});
但是,在确认后,我如何继续访问该链接或向该链接发送 ajax 帖子?