Currently creating some script files - and trying to make use of
When running as an HTA - it errors stating that Object doesn't support this property or method. I've run it as an HTM file just to check - and there is no problem at all.
So I can only assume that
x-ua-compatible meta tag.
<!DOCTYPE html> and
<meta http-equiv="x-ua-compatible" content="ie=edge" />.
Naturally, setting the
IE=edge doesn't override an old version of the installed IE, the latest available mode is used. Instead of
edge, you can use IE version numbers to downgrade the app when run with newer IEs.
Omitting DTD should always drop the app to run in Quirks mode, which in the case of HTA is similar to IE5. However, in this case, the document mode can be altered with
x-ua-compatible, but there were some inconsistencies at least in IE8 & 9. It's always safest to use DTD, if the Quirks mode isn't required.
With DTD, but without
x-ua-compatible meta tag HTAs are run in IE7 Standards mode (which doesn't support
object.defineProperty(), it's introduced in IE9).
You can read more about the subject at MSDN: Introduction to HTML Applications (HTAs)
IE version info for JS and CSS can be found at MSDN:
Here's a "safe start" for a HTA file, when you want to use the latest available version:
<!DOCTYPE html> <html> <head> <title>HTA</title> <meta http-equiv="x-ua-compatible" content="ie=edge" /> // All link, style and script tags, or any code should be placed below the five lines above
You can also use
ScriptEngine functions to find out the latest script version:
ver = ScriptEngine() + ' V '; ver += ScriptEngineMajorVersion() + '.'; ver += ScriptEngineMinorVersion() + '.'; ver += ScriptEngineBuildVersion(); alert(ver);
Notice, that this shows only the latest version provided by browser, document mode doesn't have an affect to the returned values.
©2020 All rights reserved.