How to detect IE11?

IE11 no longer reports as MSIE, according to this list of changes it’s intentional to avoid mis-detection. What you can do if you really want to know it’s IE is to detect the Trident/ string in the user agent if navigator.appName returns Netscape, something like (the untested); function getInternetExplorerVersion() { var rv = -1; if … Read more

How to target only IE (any version) within a stylesheet? [duplicate]

Internet Explorer 9 and lower : You could use conditional comments to load an IE-specific stylesheet for any version (or combination of versions) that you wanted to specifically target.like below using external stylesheet. <!–[if IE]> <link rel=”stylesheet” type=”text/css” href=”https://stackoverflow.com/questions/28417056/all-ie-only.css” /> <![endif]–> However, beginning in version 10, conditional comments are no longer supported in IE. Internet … Read more

“X-UA-Compatible” content=”IE=9; IE=8; IE=7; IE=EDGE”

If you support IE, for versions of Internet Explorer 8 and above, this: <meta http-equiv=”X-UA-Compatible” content=”IE=9; IE=8; IE=7″ /> Forces the browser to render as that particular version’s standards. It is not supported for IE7 and below. If you separate with semi-colon, it sets compatibility levels for different versions. For example: <meta http-equiv=”X-UA-Compatible” content=”IE=7; IE=9″ … Read more

X-UA-Compatible is set to IE=edge, but it still doesn’t stop Compatibility Mode

If you need to override IE’s Compatibility View Settings for intranet sites you can do so in the web.config (IIS7) or through the custom HTTP headers in the web site’s properties (IIS6) and set X-UA-Compatible there. The meta tag doesn’t override IE’s intranet setting in Compatibility View Settings, but if you set it at the … Read more

Detect IE version (prior to v9) in JavaScript

This is my preferred way of doing it. It gives maximum control. (Note: Conditional statements are only supported in IE5 – 9.) First set up your ie classes correctly <!DOCTYPE html> <!–[if lt IE 7]> <html class=”lt-ie9 lt-ie8 lt-ie7″> <![endif]–> <!–[if IE 7]> <html class=”lt-ie9 lt-ie8″> <![endif]–> <!–[if IE 8]> <html class=”lt-ie9″> <![endif]–> <!–[if gt … Read more

How can I prevent the backspace key from navigating back?

This code solves the problem, at least in IE and Firefox (haven’t tested any other, but I give it a reasonable chance of working if the problem even exists in other browsers). // Prevent the backspace key from navigating back. $(document).unbind(‘keydown’).bind(‘keydown’, function (event) { if (event.keyCode === 8) { var doPrevent = true; var types … Read more

‘innerText’ works in IE, but not in Firefox

Update: I wrote a blog post detailing all the differences much better. Firefox uses W3C standard Node::textContent, but its behavior differs “slightly” from that of MSHTML’s proprietary innerText (copied by Opera as well, some time ago, among dozens of other MSHTML features). First of all, textContent whitespace representation is different from innerText one. Second, and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)