I'm using Windows 7 with Internet Explorer 9. I have created a very precise HTA using current HTML standards. To ensure it renders properly, I specified the X-UA-Compatible meta tag for IE=9 (otherwise the HTA renders in IE7 mode by default). The tag works perfectly to force the HTA to render modern HTML properly, but this breaks the GetObject function.
Take this very simple example:
<html><head><meta http-equiv="X-UA-Compatible" content="IE=9"/><title>Test</title><HTA:Application applicationName = "Test" ID = "html_hta"/></head><body><script type="text/javascript"> var obj = GetObject("WinNT://./administrator"); alert("No error if you see this");</script></body></html>
If you save the example to a file, and run it, you'll get this error:
If you remove the <meta> tag, the HTA works as expected. I realize that I could simply remove the meta tag to fix the GetObject problem. However, the HTML wouldn't render as expected - not acceptable at all, actually (IE7 standards mode was really bad). It would take me hours and hours to find and implement work arounds for all the IE7 quirks.
Any ideas on how to fix this? Or, at least, a alternative way in javascript to accomplish what GetObject does?
-Tony