您的位置:首页 > 其它

关于IE模态弹窗的兼容性问题(以及…

2017-10-13 16:34 495 查看
这兼容IE,360,火狐,google等游览器哦 弹出页面是这样写:function selectClassify(id) {        var iTop = (window.screen.availHeight-30-570)/2; //获得窗口的垂直位置;        var iLeft = (window.screen.availWidth-10-700)/2; //获得窗口的水平位置;        try{//IE            var returnValue = window.showModalDialog(window.ctx + "/enterpriseClassify/getAll?id="+id,window,"status:no;scroll:yes;center:yes;dialogHeight:570px;dialogWidth:700px;help:no");            if(returnValue != null ){                setValue(returnValue.name);            }        }catch(e){  //非IE            window.open(window.ctx + "/enterpriseClassify/getAll?id="+id, 'newwindow','height=570,width=700,top='+iTop+',left='+iLeft+',toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no');        }    };//setValue是自己定义的赋值方法哦! function setValue(name){        $("#classifyName").val(name);    };处理结果的页面我是这样写:function getReturnValue(name){    try{        window.opener.setValue(name) ;    }catch( e ){//IE        window.returnValue = {            name: name        } ;    }    window.close() ;}================================================================================
父窗体部分js代码:

returnValue = window.showModalDialog("son.html ", window);

//for chrome  if (returnValue == undefined) {      returnValue = window.returnValue;  }  







                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐