Showing posts with label IE 10. Show all posts
Showing posts with label IE 10. Show all posts

Thursday, October 05, 2017

javascript - .includes() not working in Internet Explorer

includes is not supported in Internet Explorer (or Opera)

Instead you can use indexOf. #indexOf returns the index of the first character of the substring if it is in the string, otherwise it returns –1

or you can use below function to in your javascript and you can still use include to work in IE10 / IE11

//IE 10/IE11 fix for includes function
String.prototype.includes = function () {
    'use strict';
    return String.prototype.indexOf.apply(this, arguments) !== -1;
};

Hope this helps!

Monday, March 21, 2016

Compatibility mode in IE–Developer

Enable Compatibility mode in IE through code in .NET or Web.config or HTML meta tag.

We can achieve this by setting the value of the compatibility mode.

Web page can specify compatibility mode either by using META tag or by setting the HTTP header, note thatMETA tag will take precedence over http header when both are present.

Sol 1: META Tag- place the following code in head element of web page (HTML page).

<meta http-equiv="X-UA-Compatible" content="IE=8, IE=9"/> 

Sol 2: HTTP Header- We can configure our server to send a HTTP Header along with each page i.e., send X-UA-Compatibility: IE=8 HTTP header 

Add the following code snippet in web.config file:

<system.webServer>
    <httpProtocol>
        <customHeaders>
            <clear/>
            <add name="X-UA-Compatible" value="IE=9"/>
        </customHeaders>
    </httpProtocol>
<system.webServer>

Here are other options:

  • "IE=edge"
  • "IE=11"
  • "IE=EmulateIE11"
  • "IE=10"
  • "IE=EmulateIE10"
  • "IE=9"
  • "IE=EmulateIE9
  • "IE=8"
  • "IE=EmulateIE8"
  • "IE=7"
  • "IE=EmulateIE7"
  • "IE=5