HTA 和“x-ua-compatible"元标记 [英] HTA and 'x-ua-compatible' meta tag
问题描述
添加到 2014 年 6 月 19 日的帖子
Added to post Jun-19-2014
谢谢邦德.既然你有 IE9,我很感激你的测试.希望如果有人有 IE 10,他们也会测试它.为什么在 IE 11 引擎下只能兼容到 ie8 没有任何意义.
Thanks Bond. Since you had IE9, I appreciate your test. Hopefully if somebody out there has IE 10 they will test it, too. It does not make any sense why under the IE 11 engine you can only run compatibility up to ie8.
我创建了这个小巧的 HTA 以便发布它,希望我能找到我遗漏的东西.
I created this tiny, itty-bitty HTA in order to post it so hopefully I can find out what I am missing.
我的系统是带有 IE 11 的 Win7 Pro 64 位.
My system is a Win7 Pro 64bit with IE 11.
当我将元标记设置为:
<meta http-equiv="x-ua-compatible" content="ie=8">
HTA 运行非常热情.没问题.但是当我把它改成:
the HTA runs peachy-keen. No problems. But when I change it to:
<meta http-equiv="x-ua-compatible" content="ie=9">
它运行得不太好.
现在...我知道在 IE 11 和 VBScript 之间发生了一场大家族冲突.VBscript 永远被赶出了家门.IE 11 不再与它通信.所以我可以理解为什么将其设置为 content="ie=edge" 不起作用.但是为什么设置为 content="ie=9" 就不行了?
Now ... I know that there was a big family blow-out between IE 11 and VBScript. VBscript got booted out of the house for good. IE 11 refuses to communicate with it anymore. So I can understand why setting it to content="ie=edge" would not work. But why doesn't it work when setting it to content="ie=9"?
<!DOCTYPE html>
<head>
<meta http-equiv="x-ua-compatible" content="ie=8">
<hta:application
applicationname="Hmmmmmm"
singleinstance="yes"
id="oHTA"
>
<title>Huh? What?</title>
<script language="VBScript">
Option Explicit
Dim objFSO,file
Sub Window_OnUnLoad
Set objFSO=CreateObject("Scripting.FileSystemObject")
Set file=objFSO.OpenTextFile("c: empsubmit.txt",2,True)
file.Write oHTA.document.getElementById("aa").value
file.Close
Set objFSO=Nothing
Set file=Nothing
End Sub
Sub Window_OnLoad
window.ResizeTo 240,130
End Sub
Function Form_OnSubmit()
window.Close
Form_OnSubmit=False
End Function
</script>
</head>
<body style="margin:30px;">
<form id="form" action="">
<input id="aa" type="text" size="10" value="test">
<input type="submit" value="Submit">
</form>
</body>
</html>
以 ie8 设置在元标记中运行它工作正常......窗口弹出,调整大小,并在提交时写入文件......荣耀!
Running it as ie8 set in the meta tag works fine ... window pops up, gets resized, and writes to the file on submit ... glory-be!
将其作为 ie9 设置在元标记中运行...弹出窗口,忽略调整大小,忽略写入文件...好像所有 VBScript 都被忽略.
Running it as ie9 set in the meta tag ... window pops up, resizing is ignored, and writing to the file is ignored ... as if all the VBScript is being ignored.
我遗漏了什么信息?
推荐答案
看起来更高版本的 IE 不支持其他答案中提到的 HTA.解决您的问题的一种方法是:使您的 HTA 文件可导航(HTA 属性 navigable="yes"
)并且不指定任何 x-ua-compatible
元标记.在 HTA 文件中,导航到另一个带有 x-ua-compatible
标签的文件.您导航的文件将具有 HTA 权限:
Looks like later versions of IE is not supporting HTA as mentioned in the other answers.
One solution to your problem is: Make your HTA file navigable (HTA attribute navigable="yes"
) and do not specify any x-ua-compatible
meta tags. In the HTA file navigate to another file which has the x-ua-compatible
tag. The file you navigated will have the HTA priviliges:
HTA 文件:
<!doctype html>
<html lang="en">
<head>
<HTA:APPLICATION
navigable="yes" />
<script type="text/javascript">
<!--
document.location = 'htacontent.htm';
//-->
</script>
</head>
<body>
</body>
</html>
htacontent.htm
htacontent.htm
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
...
这篇关于HTA 和“x-ua-compatible"元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!