HTA和"x-ua兼容"元标记 [英] HTA and 'x-ua-compatible' meta tag

查看:92
本文介绍了HTA和"x-ua兼容"元标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已添加到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标签设置为:

When I set the meta tag as:

<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:\temp\submit.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>

按照meta标记中的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!

按照meta标记中的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一样,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兼容"元标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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