?$(function () { ???????????$("#GetCoupon").click(function () { ???????????????function del() { ???????????????????var msg = "请确定领取吗?\n\n请确认!"; ???????????????????if (confirm(msg) == true) { ???????????????????????return true; ???????????????????} else { ???????????????????????return false; ???????????????????} ???????????????} ???????????????if (del()) { ???????????????????var id = $(this).attr("did"); ???????????????????$.ajax({ ???????????????????????type: ‘post‘, ???????????????????????url: ‘/Home/Get‘, ???????????????????????data: { "id": id }, ???????????????????????success: function (msg) { ???????????????????????????console.log(msg); ???????????????????????????if (msg) { ???????????????????????????????alert("领取成功"); ???????????????????????????????window.location.reload(); ???????????????????????????} else { ???????????????????????????} ???????????????????????} ???????????????????}) ???????????????} else { alert("用户取消了领取"); } ???????????}) ???????})
JQ 确定与取消弹出框,选择确定执行Ajax
原文地址:https://www.cnblogs.com/SeNaiTes/p/8819544.html