How to Detect IE6 Browser with JavaScript
I have been doing a lot of work with jQuery lately. The jQuery library offers great cross browser support for most functions but unfortunately even this magic wand can’t solve all the problems with Internet Explorer 6 (IE6) compatibility. Previously, jQuery had a browser() function that helped detect a browser so that a developer could build a work around. The browser() function has been removed in favor of a new function called support() which helps determine if the current browser offers support for a specific piece of functionality. For many tasks this strategy works just fine but I have found some occasions where I need to sniff out IE6 and it can be done easily using standard JavaScript.
JavaScript function to determine if the current browser is IE6:
//CHECK FOR IE6 function is_ie6(){ return ((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)); }
There are many other ways to find IE6 but this one works great. If you have another good method please list it in the comments below.
If you enjoyed this post, please consider to leave a comment or subscribe to the feed and get future articles delivered to your feed reader.


Comments
No comments yet.
Leave a comment