【问题标题】:showModelessDialog opens the document in ie8 modeshowModelessDialog 以 ie8 模式打开文档
【发布时间】:2017-12-13 02:19:38
【问题描述】:

使用 showModelessDialog/showModalDialog 从 HTA 应用程序打开 HTML 对话框。 HTA 应用程序在 ie11 模式下运行(标签<meta http-equiv="x-ua-compatible" content="ie=11">),但打开的对话框始终在 ie8 模式下运行。打开的文档中的标签<meta http-equiv="x-ua-compatible" content="ie=11"> 不起作用。 如何在ie11模式下使用showModelessDialog/showModalDialog打开文档?这是对话框中的 svg 或 WebGL 所必需的。

Main.hta:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
    <head>
        <meta http-equiv="x-ua-compatible" content="ie=11">
    </head>

    <body>
        <a href="#" onclick="showModelessDialog ('Dialog.hta'); return false;">Open Dialog</a>  
    </body>
    <script>
        alert (navigator.userAgent);
    </script>
</html>

Dialog.hta

<html>
    <head>
        <meta http-equiv="x-ua-compatible" content="ie=11">   
    </head>
    <body>
        <script>
            alert (navigator.userAgent);
        </script>
    </body>
</html>

【问题讨论】:

  • iirc,由于 showModalDialog 在 IE10 之前已被弃用,他们将其模式冻结为 IE8。
  • @dandavis 模态对话框在 IE9、IE10 和 IE11 标准模式下非常好地在 HTML 页面上工作,它们仅在 htas 中被“冻结”。几年前我已经asked 讨论过这个问题......
  • 我尝试使用 IHostDialogHelper->ShowHTMLDialog 结果相同 - 最大 ie8。 Meta 和 FEATURE_BROWSER_EMULATION 没有解决问题。
  • 无法解决,微软多年前就已经放弃了对 HTA 的支持。不再为 IE9 更新对话框,并且无法获得对现代对话框标准的支持。唯一的方法是将常规窗口用作对话框,或者您可以使用 iframe 和/或单独的 HTA 文件实现自己的对话框系统。第三种选择是模拟带有 div 的对话框,就像现代网络应用正在做的那样。
  • 谢谢。很抱歉。一个创建简单多窗口应用程序的好机会。

标签: javascript internet-explorer-11 hta showmodaldialog


【解决方案1】:

通过创建具有两个函数 SetObject 和 GetObject 的 COM 对象解决了该问题。该对象是使用指定的here 的WM_GETOBJECT 消息发送的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-04-29
    • 1970-01-01
    • 2011-02-26
    相关资源
    最近更新 更多