javascript - Chrome 新版本 37 中的弹出问题

标签 javascript google-chrome

我无法在 Chrome 新版本中打开弹出窗口。 我单击打开模式对话框弹出窗口的链接,但弹出窗口没有出现。 我猜测这是 google chrome 新版本的问题。

function DownloadReport() {
    window.document.getElementById("MainContent_hfRefresh").value = "True";
    showmodalDialog("../../General/DownLoad/Download.aspx", 1024, 500);
}

此代码在旧版本 36 中运行良好。

最佳答案

最后我使用jquery对话框替换window.showModalDialog(): 父页面:

            var href = "test.html"
            var obj = jQuery('#chooseTaskDlg');
            if(!obj)
                return false;
            obj.html('<iframe style="border: 0px; " src="' + href + '" width="100%" height="99%"></iframe>');
            obj.dialog({
                        autoOpen: false,
                        resizable: false,
                        height:780,
                        width:950,
                        modal: true,
                        close: function(){
                            if(undefined != dialogRet && '' != dialogRet) 
                            {
                                //do something with the string dialogRet 
                            }
                            return null;
                        }
                    });
            obj.dialog('open');

然后在子页面“test.html”中:

if (isNeedIeModalDialog())   //IE
{
    obj = window.dialogArguments;
    window.returnValue = someValue;
}
else
{
    obj = window.opener ? window.opener : parent;
    obj.dialogRet = someValue;
}
obj.document.getElementById(type + '_ipinfo').value=someValue; //do something with parrent document
closeModalWindow('chooseTaskDlg');

关于javascript - Chrome 新版本 37 中的弹出问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25659205/

相关文章:

javascript - 使用生成的 div 拖放 Vanilla JS

javascript - react 组件DidUpdate : check wether state OR props change caused the update?

javascript - 通过 Google Chrome 扩展将代码注入(inject) Gmail - 如何确保我的脚本在完成加载后被注入(inject)?

javascript - 为什么 Chrome 在使用小书签时更新正文而不是文本区域值?

html - 页面在 Google Chrome 中不滚动

javascript - 在 Protractor/E2E 测试中访问 $http 数据 (AngularJS)

javascript - 如何使用innerHTML在Laravel中打印数组

javascript - 强制加载图像以停止闪烁?

javascript - 如何使用 JS 和 Chrome 控制台向 channel 发送 Discord 消息?

css - Arimo 字体似乎在任何地方都不起作用