Challenging Micrcompatibility mode

Description of your first forum.
Post Reply
shafikul
Posts: 28
Joined: Thu Jan 02, 2025 9:22 am

Challenging Micrcompatibility mode

Post by shafikul »

1. When the end user visits your website, he clicks the button on the right side of the address bar;

2. The corresponding pages in your website use the IE7 compatible string, i.e., <meta content="IE=EmulateIE7" http-equiv="X-UA-Compatible"/>, or make corresponding settings in the HTTP Header information of the Web server (IIS/Apache);

3. In order to help your company's website pages display more compatible with IE8, Microsoft has added your company's website address to a Windows Update maintenance list in the IE8 compatibility list (if list of algeria cell phone number database website is in this list and you believe that your website is actually fully compatible with W3C standards, so you want to remove it from this list, you can send an email to [email protected] to request removal).

Then in the above three cases, the UseAgent string you get will be IE7, not IE8.

So how do you correctly determine whether the current browser is IE8? Use the following code:
Actually, this question was asked to me by a client I was responsible for a while ago. A good friend from the United States, Giorgio Sardo, helped me solve this problem. In his post, there are some other contents that you may be interested in, such as how to determine whether the current browser supports WebSlice, Accelerator and Visual Search, etc. You can also read them together.
::: csharpcode 1: function getInternetExplorerVersion()

2: // Returns the version of Windows Internet Explorer or a -1

3: // (indicating the use of another browser).

4: {

5: var rv = -1; // Return value assumes failure.

6: if (navigator.appName == 'Microsoft Internet Explorer')

7: {

8: var ua = navigator.userAgent;

9: var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");

10: if (re.exec(ua) != null)

11: rv = parseFloat( RegExp.$1 );

12: }

13: return rv;

14: }

15: function checkVersion()

16: {

17: var msg = "You're not using Windows Internet Explorer.";

18: var ver = getInternetExplorerVersion();

19: if ( ver> -1 )

20: {

21: if ( ver>= 8.0 )

22: msg = "You're using a recent copy of Windows Internet Explorer."

23: else

24: msg = "You should upgrade your copy of Windows Internet Explorer.";

25: }

26: alert( msg );

27: }
:::

.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background -color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
Post Reply