如何获得HTA打开的对话框的IE9标准支持? [英] How to get IE9 standards support for dialogs opened by HTA?

查看:212
本文介绍了如何获得HTA打开的对话框的IE9标准支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些旧的HTA从Quirks翻译成IE9标准。但是,似乎HTA打开的模态和无模式对话框不支持IE9标准模式。

I'm translating some of my old HTAs from Quirks to IE9 standards. However, it seems that modal and modeless dialogs opened by HTA don't support IE9 standards mode.

测试对话框:

<!DOCTYPE html>
<html>
<head>
<title>TestDialog</title>
<meta http-equiv="x-ua-compatible" content="ie=9" />
</head>
<body>
<svg>
    <circle cx="100" cy="100" r="50" fill="#0f0" />
</svg>
</body>
</html>

在HTA主页中:

<button onclick="showModalDialog(...)">Modal</button>
<button onclick="showModelessDialog(...)">Modeless</button>

从HTA打开TestDialog时,它是空的。如果主页面是常规html文档,则对话框中将出现绿色圆圈。当从HTA打开时,如果对话文件本身是htm或hta没有区别。

When opening TestDialog from HTA, it's empty. If the main page is a regular html-document, the green circle appears in the dialog. When opening from HTA, there's no difference if the dialog file itself were htm or hta.

我还测试了 addEventListener()但它也不适用于对话框。

I've also tested addEventListener() but it also won't work in dialogs.

那么,从HTA打开时,我可以强制对话框支持IE9标准吗?

So, can I "force" dialogs to support IE9 standards when opening from HTA?

编辑

似乎模态和从HTA开放的无模式对话框在IE8的级别上。在Windows7中使用IE10时也会出现这种情况。

It seems that modal and modeless dialogs opened from HTA are on the level of IE8. This same happens when using IE10 in Windows7.

推荐答案

这个问题中的关键字的快速谷歌在Microsoft MSDN上给了我这个页面网站: http://msdn.microsoft.com/ en-us / subscriptions / ms536496(v = vs.85).aspx

A quick Google of the keywords in this question gave me this page on Microsoft MSDN site: http://msdn.microsoft.com/en-us/subscriptions/ms536496(v=vs.85).aspx

您的问题的答案在页面上。答案是在HTML的< head> 部分添加一个 x-ua兼容的元标记。

The answer to your question is on tha page. The answer is to add an x-ua-compatible meta tag to your HTML's <head> section.

引用:


默认情况下,HTA在兼容性视图中显示网页,显示IE7标准模式中的标准模式内容和IE5(Quirks)模式下的怪异模式内容。要利用当前版本的Internet Explorer可用的功能,请使用元元素为HTA定义X-UA兼容标头

By default, HTAs display webpages in Compatibility View, which displays standards-mode content in IE7 Standards mode and quirks mode content in IE5 (Quirks) mode. To utilize features available to current versions of Internet Explorer, use the meta element to define an X-UA-Compatible header for your HTA

标签看起来像这样:

<meta http-equiv="x-ua-compatible" content="ie=9">

以上是根据MSDN网站提供的。事实上,我建议使用 content =ie = edge比指定IE9模式更好。否则,当您升级到IE10时,您将失去IE10中的任何新功能。

The above is according to the MSDN site. In fact, I'd suggest that using content="ie=edge" would be better than specifying IE9 mode. Otherwise you'll lose out on any new features in IE10 when you upgrade to that.

这篇关于如何获得HTA打开的对话框的IE9标准支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆