Skip to content Skip to sidebar Skip to footer

Some None Ie Browsers Are Showing True For Ie6 Browser Detection

So I'm running jQuery 1.3.2 (yep it's old and right now I can't upgrade). Problem is I'm trying to drop IE6 support for our internal site and upgrade the browser. I have this check

Solution 1:

Don't use browser detection. Feature detection is much nicer. And if you want to display a message or something to only IE 6 users, I would recommend using conditional comments instead.

<!--[if IE 6]>
    <script type="text/javascript">
        // do something...
    </script>
<![endif]-->

Solution 2:

From jQuery Documentation

The $.browser property is deprecated in jQuery 1.3, and its functionality may be moved to a team-supported plugin in a future release of jQuery....

It is always best to avoid browser-specific code entirely where possible. The $.support property is available for detection of support for particular features rather than relying on $.browser.

Altenatively you can use:

  1. Write custome browser detector using navigator object
  2. IE conditional statements, something like this

Solution 3:

Thanks all to helped me find what I was looking for, maybe this might help others

var ie6 = $.browser.msie && parseInt($.browser.version) === 6 && typeofwindow['XMLHttpRequest'] !== "object";
if(typeofdocument.body.style.maxHeight === "undefined" && ie6) {
    alert('Your browser is IE6');
}

Solution 4:

Solution 5:

if you want a line of script to find IE6 and below and you can't use conditional comments:

if('\v'==='v' && !window.XMLHttpRequest) { // do something... }

Post a Comment for "Some None Ie Browsers Are Showing True For Ie6 Browser Detection"