Wednesday, March 9, 2016

Forcing Internet Explorer 9 to use standards document mode

In IE 9 some scripts and styles dont work correctly if standards mode is not enforced, though this browser now does not have a significant market share, it is still important for some sites to be compatible with IE 9. The stackoverflow post below explains how to enforce standards mode in IE 9.

http://stackoverflow.com/questions/10975107/forcing-internet-explorer-9-to-use-standards-document-mode

Also, one more related issue is of console.log satement, this statement throws error in IE 9 if dev tools are not open, this is because IE 9 does not automatically initialize the console object till dev tools have been opened atleast once. To fix this just add some dummy console object and log method to it. Be aware that if instead of log any other method is being used on the console class then that should also be included.




<script type="text/javascript">if (!window.console) { window.console = {}; window.console.log = function () { }; }</script>


More Info: http://stackoverflow.com/questions/7742781/why-javascript-only-works-after-opening-developer-tools-in-ie-once

No comments:

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...