jQuery MiniUI

标题: AJAX里调用 mini.open 在IE浏览器中报错 [打印本页]

作者: 七月大大    时间: 2016-11-17 10:56:29     标题: AJAX里调用 mini.open 在IE浏览器中报错

本帖最后由 七月大大 于 2016-11-17 11:00 编辑

                        $.ajax({
                                url : "XXXX.do",
                                type : "POST",
                                dataType : "JSON",
                                contentType : 'application/json',
                                cache : false,
                                data : json,
                                success : function(text) {        
                                mini.open({
                                        url: "XXXX.do",
                                        title: title,
                                        width: 800,
                                        height: 350,
                                        onload: function () {
                                            var iframe = this.getIFrameEl();
                                            var data = {id:123 };
                                            iframe.contentWindow.SetData(data);                                    
                                        },
                                        ondestroy: function (action) {
                                                window.CloseOwnerWindow();
                                                //cancel();
                                        }
                                    });
                                                window.CloseOwnerWindow();

                            },
                            error : function(jqXHR, textStatus, errorThrown) {
                                    mini.alert("处理错误: " + textStatus + " 详细内容: " + errorThrown);
                            }
                           
                        });
[attach]8370[/attach]
作者: 七月大大    时间: 2016-11-17 10:58:25

在其他浏览器可以正常跳转,在ie11 里面会报错。
作者: 七月大大    时间: 2016-11-17 13:31:28

版主大人帮我!
作者: dforce    时间: 2016-11-17 13:39:30

七月大大 发表于 2016-11-17 10:58
在其他浏览器可以正常跳转,在ie11 里面会报错。

延时调用      window.CloseOwnerWindow();看看
作者: 七月大大    时间: 2016-11-17 16:03:51

dforce 发表于 2016-11-17 13:39
延时调用      window.CloseOwnerWindow();看看

版主这样可以了但是还有一个问题,上面的代码在父页面执行完会关闭,
这时 ondestroy就会报错(应该是这个原因吧?)
        mini.open({
           url: "“,
                title: title,
                width: 800,
                height: 350,
                 onload: function () {
                var iframe = this.getIFrameEl();
                var data = {id: 123};
                iframe.contentWindow.SetData(data,type);                                    
                 },
                ondestroy: function (action) {
                window.CloseOwnerWindow();   
                                        }
                                    });

那么想关闭子页面应该用什么方法。
作者: dforce    时间: 2016-11-17 16:17:16

七月大大 发表于 2016-11-17 16:03
版主这样可以了但是还有一个问题,上面的代码在父页面执行完会关闭,
这时 ondestroy就会报错(应该是这 ...

子页面不能在父页面关闭后再关闭




欢迎光临 jQuery MiniUI (http://miniui.com/discuss/) Powered by Discuz! X2