【问题标题】:showModalDialog(externalAppHtml, ...) spawning a new window in IEshowModalDialog(externalAppHtml, ...) 在 IE 中生成一个新窗口
【发布时间】:2016-01-06 18:04:22
【问题描述】:

我已经查看了showModalDialog; Opens a New Window in IE 线程,但该解决方案对我不起作用。

我有一个 angularjs 文件,我正在使用 showModalDialog 以如下模式打开外部应用程序的 html 页面

var cUrl2 = "http://localhost/cc/CollectionLog.do?customerNbr=" + collectionItem.borrowerId + "&dealNbr=" +
            collectionItem.loanId + "&coll=log&requestBean.moduleStatus=newcsotitleLoan&fromCAS=yes";
window.showModalDialog(cUrl2, window, "title:" + windowName + ";dialogWidth:" + winWidth + ";dialogHeight:" +
            winHeight + ";center:yes");

我已经试过放了

<base target="_self" />

但在打开对话框后仍会生成另一个窗口。我怎样才能解决这个问题。有没有更好的方法来打开另一个应用程序提供的 html 模式窗口(这有关系吗?)。我应该查找并修复该外部应用程序的 html 中的其他特定内容吗?

【问题讨论】:

  • 您使用的是过时的浏览器 API。 showModalDialog:“此功能已从 Web 标准中删除。尽管某些浏览器可能仍支持它,但它正在被删除。请勿在旧项目或新项目中使用它。使用它的页面或 Web 应用程序可能会损坏随时。” “Chrome 37 中已删除支持。” “Mozilla 已宣布将取消对这种方法的支持。”
  • 我们仍在使用 IE9。虽然我们计划迁移到 IE11,但我们需要向后兼容 IE9。不幸的是:(

标签: angularjs modal-dialog window showmodaldialog


【解决方案1】:
var winHeight = $(window).height() - 100;
var winWidth = $(window).width() - 200;
var windowOptions = 'toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,width=' + winWidth +
            ',height=' + winHeight + ',left=100,top=100';
cUrl = xxxx.html
window.open(cUrl, "win", windowOptions);

我改用 window.open 并且它起作用了。解决我的问题的完美选择。

【讨论】:

    猜你喜欢
    • 2013-04-21
    • 2010-09-13
    • 1970-01-01
    • 1970-01-01
    • 2016-03-29
    • 2013-12-23
    • 1970-01-01
    • 1970-01-01
    • 2015-10-17
    相关资源
    最近更新 更多