我想知道是否可以在第二次单击时忽略 jQuery 函数的执行,以便我可以创建传递,但只有当用户在确认单击时单击“是”时。我有显示确认框,但无法找到一种方法来做到这一点。
$(function()
{
$(".msgbox-confirm").live("click", function(e)
{
e.preventDefault();
$.msgbox("Are you sure you want to permanently delete this element?", {
type: "confirm",
buttons: [
{ type: "submit", value: "Yes" },
{ type: "submit", value: "No" }
]
}, function(result)
{
if (result == "Yes") {
// passthrough code goes here!
}
});
});
});