How to get support for IE9 standards for dialogs opened by HTA?

I have converted some of my old HTA from Quirks to IE9 standards. However, it seems that the modal and feeble dialogs opened by HTA do not support IE9 standards mode.

Test Dialog Box:

<!DOCTYPE html> <html> <head> <title>TestDialog</title> <meta http-equiv="x-ua-compatible" content="ie=9" /> </head> <body> <svg> <circle cx="100" cy="100" r="50" fill="#0f0" /> </svg> </body> </html> 

On the HTA homepage:

 <button onclick="showModalDialog(...)">Modal</button> <button onclick="showModelessDialog(...)">Modeless</button> 

When you open TestDialog from the HTA, it is empty. If the main page is a regular html document, a green circle appears in the dialog box. When opening with HTA, it makes no difference if the dialog file itself was htm or hta.

I also tested addEventListener() , but it will also not work in dialogs.

So, can I "force" dialogs to support IE9 standards when opening from HTA?


EDIT

It seems that the modal and non-modal dialogs open from the HTA are at the IE8 level. The same thing happens when using IE10 in Windows7.

+3
source share
1 answer

A quick Google keyword on this issue gave me this page on the Microsoft MSDN website: http://msdn.microsoft.com/en-us/subscriptions/ms536496(v=vs.85).aspx

The answer to your question is on this page. The answer is to add the x-ua-compatible meta tag to your HTML <head> section.

Quote:

By default, HTAs displays web pages in a compatibility view that displays the contents of standard mode in IE7 standards mode and quirks mode in IE5 (Quirks) mode. To use the features available for current versions of Internet Explorer, use the meta element to define the X-UA-Compatible header for your HTA

The tag will look like this:

 <meta http-equiv="x-ua-compatible" content="ie=9"> 

The above corresponds to the MSDN site. In fact, I would suggest that using content="ie=edge" would be better than specifying IE9 mode. Otherwise, you will lose all the new features in IE10 when upgrading to this.

+1
source

Source: https://habr.com/ru/post/1446193/


All Articles