【问题标题】:showmodalDialog issue in chrome new versionchrome新版本中的showmodalDialog问题
【发布时间】:2014-09-14 17:08:30
【问题描述】:

新版本中的谷歌浏览器删除了 showmodalDialog 。 我在这个浏览器上的代码不起作用我该如何解决我的问题?

function AddTime(OfferTime) {
    var x = new Array();
    var ClsPartColeg = document.getElementById("ClassParam").value;
    x[0] = SrcName(ClsPartColeg, 'PartCombo');
    if (OfferTime)
        x[1] = OfferTime;
    else
        x[1] = '$$0$' + SrcName(ClsPartColeg, 'College') + '$';
    var s = showModalDialog("../HtmlPage/ClsTime.htm", x, "status:0;help:0;dialogWidth:420px;dialogHeight:100px");
    if (s)
        Perform('NewTime;Item=' + s);
}

【问题讨论】:

    标签: c# javascript google-chrome showmodaldialog


    【解决方案1】:

    你有两个选择:

    1- 使用 jQuery 软模态插件,该插件使用 iframe 显示您的模态 URL 并添加阻止层以防止用户与父页面交互

    2- 使用window.open 打开您的模态,并使用onbluronload 保持对模态页面的关注,直到用户关闭它

    <body onblur="self.focus()" onload="self.focus()">   
    

    第二种方法用起来很烦,不推荐

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-15
      • 1970-01-01
      • 2017-06-29
      • 1970-01-01
      • 1970-01-01
      • 2013-11-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多