问题
I am using Google Chrome and I tryed to make an application for my computer using HTML. Of course I just convert file to .hta and add
<HTA:APPLICATION ID="GregsonTools"
APPLICATIONNAME="Gregson Tools"
BORDER="no"
CAPTION="yes"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
ICON="icon.ico"
WINDOWSTATE="normal">
But JavaScript alpplication didn't work. Than I made a test and open my HTML application in Internet explrer. The same things weren't working as in HTA document.
Maybe is IE using weird kind of HTML and it cannot reading some elements of ordinary HTML. If anybody had same problem and know solution please help.
回答1:
Chrome (or any other browser) doesn't support HTAs at all. Actually HTAs are run by mshta.exe, and IE is used as a rendering & scripting engine.
When HTA is run with IE9 (<meta http-equiv="x-ua-compatible" content="IE=9">
) there are some issues with <HTA: application>
, like some mess with icon
and window borders.
With IE10 (<meta http-equiv="x-ua-compatible" content="IE=edge">
) it seems, that HTA properties are ignored totally, even singleInstance="yes"
doesn't work. If you take a look at a runtime source, you can see the <HTA: application>
tag is moved to the body
, where it has not the expected influence.
All above written about IE is related to the actual HTA properties only, all HTML, scripts and privilegs work well. With IE10 even better and faster than ever before, and you can use real JavaScript instead of JScript.
To utilize all available features, you need to add document type and x-ua-compatible
to your pages:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="x-ua-compatible" content="IE=edge">
...
来源:https://stackoverflow.com/questions/16857014/html-tags-does-not-in-hta