gpt4 book ai didi

javascript - 无法理解如何使用 javascript 和 jquery 代码来做到这一点

转载 作者:行者123 更新时间:2023-11-30 05:52:28 25 4
gpt4 key购买 nike

很抱歉问了这个愚蠢的问题,但我对此有疑问。有这样的脚本,它应该返回 true 或 false,但是在绘制该 html 弹出窗口并从该方法获得响应之后。

           $("#pageInfo a.btnDel").click(function () {

$("#cmsSmallPopUpWindowMessage").html("<h2>Do you really want to delete this page?</h2><center><div style='width:130px'><ul class='bactions'><li><a id='cmsSmallPopUpWindowBYes' href='javascript:void(0)'><span><span>Yes</span></span></a></li><li><a id='cmsSmallPopUpWindowBNo' href='javascript:void(0)'><span><span>No</span></span></a></li></ul><div class='archor'></div></div></center>");
$.blockUI({ message: $("#cmsSmallPopUpWindow"), css: { width: "530px", border: "0px", backgroundColor: "transparent"} });
setTimeout(function () {
$.unblockUI();
}, 6000);


$("#cmsSmallPopUpWindowBNo").click(function () {
$.unblockUI();
return false;
});


$("#cmsSmallPopUpWindowBYes").click(function () {
$.unblockUI();
location.reload();
return onDelete($(this).attr('href'));
});
return true; // this should change for "false" or "true" but after click on "yes" or "no"


});

最佳答案

我建议使用 jQueryUI modal-confiramtion dialog .它恰好满足您的需求,阻止 UI(模态),具有漂亮的布局和异步工作(不卡住脚本)。

关于javascript - 无法理解如何使用 javascript 和 jquery 代码来做到这一点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13878339/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com