I tried the following code in a .hta file, and various permutations of it, but the userAgent string always shows "compatible; MSIE 7.0;". If I add the same code to a .html file and open directly in IE8, it displays the correct string "compatible; MSIE 8.0;". How can one force IE8 standards mode in an HTA?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Compatibility Test</title>
<HTA:APPLICATION ID="testApp" APPLICATIONNAME="Compatibility Test" >
</head>
<body onload="document.write(window.navigator.userAgent);">
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<title>Compatibility Test</title>
<HTA:APPLICATION ID="testApp" APPLICATIONNAME="Compatibility Test" >
</head>
<body onload="document.write(window.navigator.userAgent);">
</body>
</html>