window.showModalDialog

今天接手一个项目用到window.showModalDialog以前完全没有过,既然碰到了就记下来。

function showModalWindow(){
          //var answer = window.showModalDialog(url,window,‘dialogWidth:1200px;dialogHeight:700px‘);
            var orgId = $("#orgId").text();
            var projectList = window.showModalDialog("doctor/inputTestProject?orgId="+orgId,null,
                "dialogWidth=1100px;dialogHeight=590px;center:yes;resizable:no;status:no;scroll:no;");

            console.info(projectList);
            if(typeof(projectList)=="undefined")return false;
            $("#packageId").val(projectList[0].packageId);
            $("#packageMoney").val(projectList[0].packageMoney);
            if (projectList != null && typeof(projectList) != "undefined" && projectList.length > 0){
                $("tr[name=‘mo‘]").each(function(){
                         $(this).remove();
                    });
                var ids = [];
                var str = "";
                $("#ProjTab tr").each(function(index, item){
                       ids.push(item.id);
                });

                for(var i = 0; i<projectList.length; i++){
                        str += "<tr name=‘mo‘ id=‘"+projectList[i].projectId+"‘ rowType=‘add‘>"
                        +"<td class=‘biaotd‘>"+Number(i+1)+"</td>"
                        +"<td class=‘biaotd‘>"+projectList[i].projectName+"</td>"
                        +"<td class=‘biaotd‘>"+projectList[i].projectType2Name+" &nbsp;</td></tr>"
                    }
                $("#ProjTab tr:last-child").before(str);
                changeFrame();
            }
        //window.location.reload(); //刷新父窗口
    }
window.showModalDialog弹出一个模态窗口,窗口关闭之前该方法会一直阻塞在哪里,窗口关闭之后才会继续往下执行(即窗口关闭之后才会执行包含console.info(projectList);之后的语句);欢迎大家前来指正
时间: 2024-08-30 03:03:36

window.showModalDialog的相关文章

.window.showModalDialog 传值

1.window.showModalDialog("OA_JDB.html",StrZy, "dialogWidth=600px;dialogHeight=200px"); } 2,    document.getElementById("p1").innerHTML = window.dialogArguments; .window.showModalDialog 传值,布布扣,bubuko.com

window.showModalDialog()之返回值

window.showModalDialog的基本用法 showModalDialog() (IE 4+ 支持) showModelessDialog() (IE 5+ 支持) window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框. window.showModelessDialog()方法用来创建一个显示HTML内容的非模态对话框. 使用方法: vReturnValue = window.showModalDialog(sURL [, vArgument

js window.showModalDialog

window showModalDialog 内容 (1)父页面打开窗口 (2)父页面向子页面传递参数 (3)子页面获取父页面传递的参数,并且返回一定的值. 代码: function getHQ1(option){ //父页面通过2种方式,向子页面传递参数 //1)直接在url中加参数与值.           如:/TBPWeb/technology/institutionManager/technologyTextarea.jsp?opt=2 //2)var obj = new Object

window.showModalDialog 与window.open传递参数的不同?

简单的说,就是一个在弹出窗口之后可以做其它的事,即window.open 另一个在弹出窗口之后不能做其它的事,只能是关闭了当前的窗口之后才能做其它的事,即window.showModalDialog 那么两者在使用上有什么不同呢?他们分别是如何和父窗口进行交互的呢? 先来看window.showModalDialog的例子: 我这里现在有一个父窗体parent.jsp,它里面有一个方法 function openChild(){                var temp = window.

window.open()与window.showModalDialog

弹出窗口两种方式:    1.window.showModalDialog:      var feature = "dialogWidth:615px;dialogHeight:505px;status:no;help:no;scroll:no;resizable:no;center:yes";      window.showModalDialog(url, Object(传给弹出窗口的参数,可以是任何类型),feature)       决定窗口的外观是第三个参数feature,

window.showModalDialog父子窗口参数传递

在开发过程中遇到window.showModalDialog()打开的模态对话框需要从子窗口传递返回值给父窗口中的某个插件,开始想通过window.opener得到,但是试了几次得不到,后来发现原来在当前打开窗口(子窗口)中可以通过window.returnValue=指定返回值;window.close();之后父窗口可以使用var result = window.showModalDialog(url,window,"dialogWidth=600px;dialogHeight=500px;

JS中window.showModalDialog()详解

window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框. window.showModelessDialog()方法用来创建一个显示HTML内容的非模态对话框. 使用方法: vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]) vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures

window.showModalDialog()的简单用法

//创建一个显示html内容的模态对话框: vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]) //创建一个显示html内容的非模态对话框: vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures]) sURL:(必选参数)字符串..指定要显示的文档的URL vArguments:任意类型..想要显示的页面传递参数.

IE中用window.showModalDialog代替prompt confirm

在子页面中设置 1.可传递参数 window.dialogArguments 2 返回值 window.returnValue 基本介绍:          showModalDialog()         (IE 4+ 支持)          showModelessDialog()      (IE 5+ 支持)          window.showModalDialog()                  方法用来创建一个显示HTML内容的模态对话框.          wind

JS中window.showModalDialog()详解 HTML DOM open() 方法

window.showModalDialog()方法用来创建一个显示HTML内容的模态对话框. window.showModelessDialog()方法用来创建一个显示HTML内容的非模态对话框. 使用方法: vReturnValue = window.showModalDialog(sURL [, vArguments] [,sFeatures]) vReturnValue = window.showModelessDialog(sURL [, vArguments] [,sFeatures