HighDots Forums  

Detecting Internet Explorer 6

Javascript JavaScript language (comp.lang.javascript)


Discuss Detecting Internet Explorer 6 in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
RobG
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 10-31-2009 , 06:54 PM






On Oct 31, 6:43*pm, Swifty <steve.j.sw... (AT) gmail (DOT) com> wrote:
Quote:
I know that detecting the browser is frowned upon here, but I have a
need to identify specifically Internet Explorer 6.

My company ships all employees a PC containing IE6, and we are
discouraged from upgrading it. We can (and many do) install other
browsers, but some corporate applications are 100% dependant on IE6.

However, next year (about halfway through), we are going to force the
installation of Firefox onto all systems, and it is speculated that it
may become the default browser as well. Maybe not at the same time.

I'd like to update my webpages with a "This page best viewed with almost
anything except Internet Explorer 6" message, to encourage my users to
try something else (probably Firefox).
If this is for an intranet, the reason IE is being used is probably
because it was the corporate standard. Your message should be honest,
something like:

"You seem to be using IE 6. It is no longer the standard corporate
browser, please upgrade to one of <list suitable browsers>."

Information on how to get technical support to do the install and
perhaps assistance with bookmarks, add-ons, etc. would be helpful too.

--
Rob

Reply With Quote
  #12  
Old   
David Mark
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 10-31-2009 , 08:36 PM






On Oct 31, 6:21*pm, Dr J R Stockton <reply0... (AT) merlyn (DOT) demon.co.uk>
wrote:
Quote:
In comp.lang.javascript message <e4WdnckhUoAkZXbXnZ2dnUVZ8s-
dn... (AT) brightview (DOT) com>, Sat, 31 Oct 2009 08:43:31, Swifty
steve.j.sw... (AT) gmail (DOT) com> posted:

I know that detecting the browser is frowned upon here, but I have a
need to identify specifically Internet Explorer 6.

Testing either
* * (0.007).toFixed(2)
or
* * S = "3000000000000000000000000" ; parseFloat(S+".0")/parseFloat(S)
will identify IE : the second in at least IE 4 to IE 8, and the first in
all versions from the introduction of toFixed to IE 8. *Use those in
addition to conditional compilation, and you have belt-and-braces.

There is, I suppose, some risk of MS correcting those bugs; but that
will not worry you.

What should worry you is other implementations with similar bugs. If
you have to come up with an object inference for IE (you don't in this
case), there are better tests than this. The OP wants to target 6 and
we know that XMLHttpRequest was not introduced until 7. Combine that
with detection of ActiveXObject, window.external,
document.documentElement.filters,
document.documentElement.style.filter, document.expando, etc. and you
can be pretty sure you've got IE6 (or at least its version of MSHTML),
for what that's worth (nothing in most cases).

Reply With Quote
  #13  
Old   
Eric Bednarz
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 05:24 AM



David Mark <dmark.cinsoft (AT) gmail (DOT) com> writes:

Quote:
[…] The OP wants to target 6 and
we know that XMLHttpRequest was not introduced until 7. Combine that
with detection of ActiveXObject, window.external,
document.documentElement.filters,
document.documentElement.style.filter, document.expando, etc. and you
can be pretty sure you've got IE6
If it *has* to be script based for some reason, I’d rather combine that
with conditional compilation. And then only if a false positive would
just result in an unnecesary performance hit (e.g. using filters where
it isn’t necessary), because we also know that the native XMLHttpRequest
object can be disabled in the IE 7/8 preferences.

Reply With Quote
  #14  
Old   
VK
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 05:49 AM



David Mark wrote:
Quote:
The OP wants to target 6 and
we know that XMLHttpRequest was not introduced until 7. *Combine that
with detection of ActiveXObject, window.external,
document.documentElement.filters,
document.documentElement.style.filter, document.expando, etc. and you
can be pretty sure you've got IE6 (or at least its version of MSHTML)
Before I thought that your preferred way to change a light bulb is to
turn yourself around the lamp (your "feature detection" stuff was
rather convincing on that). Now I see that I was mistaken: if you are
in the misfortune to change a light bulb then you have to call someone
so to sit on his shoulders and ask him to turn around while you are
holding the bulb.
The correct documented and absolutely reliable way was already given
(conditional comments and/or conditional compilation). It comes with
vendor's documentation on version vector as well:
http://msdn.microsoft.com/en-us/library/ms537512%28VS.85%29.aspx#Version_Vectors
For Validator concerned also see "Valid HTML for downlevel-revealed
conditional comments" in comments at the bottom of the page.

Reply With Quote
  #15  
Old   
Swifty
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 01:23 PM



RobG wrote:
Quote:
If this is for an intranet, the reason IE is being used is probably
because it was the corporate standard. Your message should be honest,
something like:

"You seem to be using IE 6. It is no longer the standard corporate
browser, please upgrade to one of <list suitable browsers>."
Very perspicacious of you; yes, it will be deployed on our Intranet.
Unfortunately it *is* still the default browser for those with Windows.
Firefox will become the default in just over 6 months. I'm just hoping
to persuade people to help me test my pages before the "big bang" day. :-)
I know that my pages work when one person uses them (me), and I know
that they work when a few thousand people use them (courtesy of the
server access logs). What worries me is when I suddenly have to deal
with 100's of thousands of them, prying into all the obscure niches of
my hopelessly primitive JavaScript.

It remains true that my page is much better viewed with Firefox, if only
for performance reasons, but I'm trying not to be partisan, hence
"better with almost anything except IE6". I will give a pointer to our
internal download site for Firefox though, as I wish to be seen toeing
the corporate line. Looks better in the annual review.

--
Steve Swift
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Reply With Quote
  #16  
Old   
David Mark
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 03:42 PM



On Nov 1, 5:49*am, VK <schools_r... (AT) yahoo (DOT) com> wrote:
Quote:
David Mark wrote:
The OP wants to target 6 and
we know that XMLHttpRequest was not introduced until 7. *Combine that
with detection of ActiveXObject, window.external,
document.documentElement.filters,
document.documentElement.style.filter, document.expando, etc. and you
can be pretty sure you've got IE6 (or at least its version of MSHTML)

Before I thought that your preferred way to change a light bulb is to
turn yourself around the lamp (your "feature detection" stuff was
rather convincing on that).
You mean the "stuff" that is now pretty much pervasive? Name one
"major" (or even minor) library that hasn't been influenced by My
Library and associated articles.

Quote:
Now I see that I was mistaken: if you are
in the misfortune to change a light bulb then you have to call someone
so to sit on his shoulders and ask him to turn around while you are
holding the bulb.
You realize you are agreeing with Stockton that the JScript toFixed
bug is a good inference for IE?

Quote:
The correct documented and absolutely reliable way was already given
(conditional comments and/or conditional compilation).
I know. I recommended the former. Nobody uses the latter. Try re-
reading the thread.

Reply With Quote
  #17  
Old   
VK
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 04:35 PM



David Mark wrote:
Quote:
You mean the "stuff" that is now pretty much pervasive? *Name one
"major" (or even minor) library that hasn't been influenced by My
Library and associated articles.
Never knew about My Library and about its global influence on
JavaScript library development. Something important happened I guess
over 6 months when I was not posting and reading c.l.j. Well, it is a
huge success I guess to make it in 6 months into all established
frameworks. It is especially amazing given that just 8 months ago you
were making only preliminary steps by searching a really robust way to
check getElementById availability. And back in 2008 you stated that
"The currently popular general-purpose JavaScript-based frameworks?
You can go right down the list. They are not good and don't seem to
be getting any better. For most, the only way they could get better
is if they disappeared."
( http://groups.google.com/group/comp.lang.javascript/msg/9a930670c1123e82
)

BTW is this My Library as at http://www.cinsoft.net/mylib.html ?
In this case jQuery, MooTools and Prototype.js are very disrespectful
by not mentioning you:
http://docs.jquery.com/Contributors
http://mootools.net/developers
http://www.prototypejs.org/core

I found though one David Mark in the "list of individuals who have
signed Dojo CLAs":
http://www.dojotoolkit.org/dojo-contributors
That must be you?

Quote:
You realize you are agreeing with Stockton that the JScript toFixed
bug is a good inference for IE?
What a bs? I always use official documented vendor's tools first, and
different bugs and hacks only as the 2nd option. Say till very
recently Safari didn't have document.compatMode property yet it had
two distinct rendering mode like others. So before ver.4 some trickery
had to be used.

Quote:
The correct documented and absolutely reliable way was already given
(conditional comments and/or conditional compilation).

I know. *I recommended the former. *Nobody uses the latter. *Try re-
reading the thread.
"Nobody" who?

Reply With Quote
  #18  
Old   
kangax
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 05:14 PM



VK wrote:

Quote:
[...] Say till very
recently Safari didn't have document.compatMode property yet it had
two distinct rendering mode like others. So before ver.4 some trickery
had to be used.
Not really. Safari 3.1.2 already has it.

[...]

--
kangax

Reply With Quote
  #19  
Old   
David Mark
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 05:15 PM



On Nov 1, 4:35*pm, VK <schools_r... (AT) yahoo (DOT) com> wrote:
Quote:
David Mark wrote:
You mean the "stuff" that is now pretty much pervasive? *Name one
"major" (or even minor) library that hasn't been influenced by My
Library and associated articles.

Never knew about My Library and about its global influence on
JavaScript library development.
Well, that's not surprising as the list of things you don't know about
is staggering.

Quote:
Something important happened I guess
over 6 months when I was not posting and reading c.l.j. Well, it is a
huge success I guess to make it in 6 months into all established
frameworks.
Try reading first. You'll need to go back a couple of years (or just
read the copyright).

Quote:
It is especially amazing given that just 8 months ago you
were making only preliminary steps by searching a really robust way to
check getElementById availability.
Eight months ago, you say? So early Spring of this year? Doesn't
sound right.

Quote:
And back in 2008 you stated that
"The currently popular general-purpose JavaScript-based frameworks?
They are not good and don't seem to
be getting any better. *For most, the only way they could get better
is if they disappeared."
So? Seems most of them heard me.

Quote:
*(http://groups.google.com/group/comp.lang.javascript/msg/9a930670c1123e82
)

BTW is this My Library as athttp://www.cinsoft.net/mylib.html?
Yes.

Quote:
In this case jQuery, MooTools and Prototype.js are very disrespectful
by not mentioning you:
*http://docs.jquery.com/Contributors
*http://mootools.net/developers
*http://www.prototypejs.org/core
Aha. You are on to something. Now keep going...

Quote:
I found though one David Mark in the "list of individuals who have
signed Dojo CLAs":
*http://www.dojotoolkit.org/dojo-contributors
That must be you?
Spot on!

Quote:
You realize you are agreeing with Stockton that the JScript toFixed
bug is a good inference for IE?

What a bs? I always use official documented vendor's tools first, and
different bugs and hacks only as the 2nd option.
It was BS, wasn't it? So why did you chime in with that?

Quote:
Say till very
recently Safari didn't have document.compatMode property yet it had
two distinct rendering mode like others. So before ver.4 some trickery
had to be used.
You don't know what you are talkin about (as usual). We just had this
discussion (for about the umpteenth time). The algorithm used in My
Library, which will be ported to Dojo in the near future, is fine for
Safari 2 (among virtually every other browser released this century
and some from the 90's). That code hasn't changed for years. If you
want to trace the lineage further, try to find Richard's examples as
that's where I got my ideas. And, until recently, most of the
"majors" used browser sniffing (the trickery you refer to I assume)
for this and virtually everything else. See the progression now?

Reply With Quote
  #20  
Old   
Dr J R Stockton
 
Posts: n/a

Default Re: Detecting Internet Explorer 6 - 11-01-2009 , 05:17 PM



In comp.lang.javascript message <c7ebf289-542a-4c87-a323-a67f0bbf1bd0@m2
5g2000vbi.googlegroups.com>, Sat, 31 Oct 2009 17:36:38, David Mark
<dmark.cinsoft (AT) gmail (DOT) com> posted:
Quote:
On Oct 31, 6:21*pm, Dr J R Stockton <reply0... (AT) merlyn (DOT) demon.co.uk
wrote:
In comp.lang.javascript message <e4WdnckhUoAkZXbXnZ2dnUVZ8s-
dn... (AT) brightview (DOT) com>, Sat, 31 Oct 2009 08:43:31, Swifty
steve.j.sw... (AT) gmail (DOT) com> posted:

I know that detecting the browser is frowned upon here, but I have a
need to identify specifically Internet Explorer 6.

Testing either
* * (0.007).toFixed(2)
or
* * S = "3000000000000000000000000" ; parseFloat(S+".0")/parseFloat(S)
will identify IE : the second in at least IE 4 to IE 8, and the first in
all versions from the introduction of toFixed to IE 8. *Use those in
addition to conditional compilation, and you have belt-and-braces.

There is, I suppose, some risk of MS correcting those bugs; but that
will not worry you.


What should worry you is other implementations with similar bugs.
Who else would do that? Only the biggest American organisations can
consistently sustain that level of incompetence.

--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links;
Astro stuff via astron-1.htm, gravity0.htm ; quotings.htm, pascal.htm, etc.
No Encoding. Quotes before replies. Snip well. Write clearly. Don't Mail News.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.