Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #35114

Re: Detecting IE11 ?

From Jon Ribbens <jon+usenet@unequivocal.eu>
Newsgroups comp.lang.javascript
Subject Re: Detecting IE11 ?
Date 2018-05-24 15:32 +0000
Organization A noiseless patient Spider
Message-ID <slrnpgdmp9.557.jon+usenet@sable.unequivocal.eu> (permalink)
References <3120d5a3-6a6a-4a1d-88f5-da7510b252da@googlegroups.com>

Show all headers | View raw


On 2018-05-19, Dr J R Stockton <J.R.Stockton@physics.org> wrote:
> I may need to detect Internet Explorer, since I use an external
> script which, as I use it, fails in IE8 & IE11 (and, I suppose,
> in other IE).  That script works, as I use it, in Chrome, Edge,
> Firefox, Opera, Vivaldi - in Windows XP, 7, 10.
>
> I can detect IE8 and earlier :
> document.getElementById("X").disabled = +(0.007).toFixed(2) == 0
>
> Is there a good way of detecting IE11 - or, better, any IE ?
> Maybe using   RegExp \s   on some obscure Unicode pseudo-space
> character?

I've done this before to detect IE6, I would assume similar code would
work with any version of IE:

    var div = document.createElement('div')
    div.innerHTML = '<!--[if lte IE 6]><i>a</i><![endif]-->'
    if (div.getElementsByTagName('i').length) /* it's IE6 */

The following URL explains the conditions you can use:

https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/ms537512(v=vs.85)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Detecting IE11 ? Dr J R Stockton <J.R.Stockton@physics.org> - 2018-05-19 13:59 -0700
  Re: Detecting IE11 ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2018-05-19 23:25 +0200
    Re: Detecting IE11 ? Dr J R Stockton <J.R.Stockton@physics.org> - 2018-05-20 08:35 -0700
  Re: Detecting IE11 ? JJ <jj4public@vfemail.net> - 2018-05-20 18:41 +0700
  Re: Detecting IE11 ? Ross McKay <au.net.webaware.rosko@invalid.invalid> - 2018-05-23 08:36 +1000
    Re: Detecting IE11 ? Dr J R Stockton <J.R.Stockton@physics.org> - 2018-05-23 14:32 -0700
  Re: Detecting IE11 ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-05-23 15:16 -0700
    Re: Detecting IE11 ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-05-24 21:44 +0200
      Re: Detecting IE11 ? "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2018-05-31 23:27 -0700
        Re: Detecting IE11 ? Dr J R Stockton <J.R.Stockton@physics.org> - 2018-06-01 03:19 -0700
  Re: Detecting IE11 ? Joao Rodrigues <jr@yahoo.com> - 2018-05-23 23:52 -0300
  Re: Detecting IE11 ? Jon Ribbens <jon+usenet@unequivocal.eu> - 2018-05-24 15:32 +0000
    Re: Detecting IE11 ? Joao Rodrigues <jr@yahoo.com> - 2018-05-24 15:59 -0300
      Re: Detecting IE11 ? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2018-07-15 00:40 +0200

csiph-web