首页 > 其他 > 详细

showModalDialog改进版,包括Chrome下的特殊处理

时间:2015-09-23 16:36:39      阅读:253      评论:0      收藏:0      [点我收藏+]

父页面:

    if(window.ActiveXObject){ //IE  
        $("#choose_entp").click(function(){  
            var returnValue = window.showModalDialog("SelectEntpInfo.do?mod_code=${af.map.mod_code}&xxx=" + Math.random(), window, "dialogWidth:630px;status:no;dialogHeight:440px");  
            if(returnValue != null ){  
                setValue(returnValue.id,returnValue.name);  
            }  
        });  
    }else{  //非IE  
        $("#choose_entp").click(function(){  
            window.open("SelectEntpInfo.do?mod_code=${af.map.mod_code}&xxx=" + Math.random(), ‘newwindow‘,‘height=440,width=630,top=150,left=300,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no‘);  
        });  
    }  
      
    function setValue(id,name){  
        $("#entp_id").val(id);  
    }

子页面处理:

                if(window.ActiveXObject){ //IE  
                    window.returnValue = str ;
                }else{ //非IE  
                    if(window.opener) {  
                        window.opener.setValue(str) ;  
                    }  
                }

                window.close();

showModalDialog改进版,包括Chrome下的特殊处理

原文:http://www.cnblogs.com/songjinduo/p/4832407.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!