无法理解如何使用javascript和jquery代码
16lz
2021-01-22
Sorry guys for asking that dumb question but I have problem with that thing. Have such script, it should return true or false, but after drawing that html pop-up window and getting response from that methods.
对不起,有人问这个愚蠢的问题,但我对那件事有疑问。有这样的脚本,它应该返回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"
});
1 个解决方案
#1
1
I would suggest to use the jQueryUI modal-confiramtion dialog. It just fits your needs, blocks the UI (modal), has a nice layout and works assync (not freezing the script).
我建议使用jQueryUI模态配置对话框。它只是满足您的需求,阻止UI(模态),具有良好的布局和工作assync(不冻结脚本)。
更多相关文章
- 如何在java脚本中获取节点内部文本?
- 如何使用jQuery的叠加对话框作为反馈表单
- 如何从Python脚本向jQuery发送JSON对象?
- 开发学习Jquery实例---双击表格弹出模态对话框,编辑提交数据
- bootstrap,模态对话框,shown.bs.modal事件不会触发
- 当AJAX响应来自PHP文件时,如何显示以消息为中心的加载器图像&防止
- 为什么使用observe_field代码不能使用JQuery模型对话框?
- jQuery UI对话框调整大小关闭按钮
- 最简单jquery.ajax+php例子(对话框显示文本框输入内容),以小见大