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(不冻结脚本)。

更多相关文章

  1. 如何在java脚本中获取节点内部文本?
  2. 如何使用jQuery的叠加对话框作为反馈表单
  3. 如何从Python脚本向jQuery发送JSON对象?
  4. 开发学习Jquery实例---双击表格弹出模态对话框,编辑提交数据
  5. bootstrap,模态对话框,shown.bs.modal事件不会触发
  6. 当AJAX响应来自PHP文件时,如何显示以消息为中心的加载器图像&防止
  7. 为什么使用observe_field代码不能使用JQuery模型对话框?
  8. jQuery UI对话框调整大小关闭按钮
  9. 最简单jquery.ajax+php例子(对话框显示文本框输入内容),以小见大

随机推荐

  1. 将css添加到jquery数据表中的特定单元格
  2. 使用jQuery将行添加到表的tbody
  3. Jquery ready和window.onload方法区别
  4. jquery插件——仿新浪微博限制输入字数的
  5. KendoUI和jQuery 1.9.0的问题
  6. jQuery.zTree 点击节点展开折叠子节点
  7. jquery 生成table表格 部分代码
  8. 如何部署Bower安装的软件包?
  9. 用WordPress决定jQuery的版本?
  10. jQuery无法从localhost检索数据