<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx</link><description>A question I’ve been asked recently is “How can I detect IE8 using JavaScript?”. There are several ways to accomplish this task, and each one will have his pros and cons. In this post I will show the best practices to detect IE8 on real world scenarios.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How to detect IE8 using JavaScript (Client side) | Microsoft Share Point</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9549839</link><pubDate>Wed, 15 Apr 2009 05:11:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9549839</guid><dc:creator>How to detect IE8 using JavaScript (Client side) | Microsoft Share Point</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://microsoft-sharepoint.simplynetdev.com/how-to-detect-ie8-using-javascript-client-side/"&gt;http://microsoft-sharepoint.simplynetdev.com/how-to-detect-ie8-using-javascript-client-side/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>Interesting Finds: 2009 04.16~04.22</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9560770</link><pubDate>Wed, 22 Apr 2009 03:16:20 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9560770</guid><dc:creator>gOODiDEA</dc:creator><description>&lt;p&gt;Web 7WaystoQuicklyRateWebsiteQuality&lt;/p&gt;
&lt;p&gt;HowtodetectIE8usingJavaScript(Clientside)&lt;/p&gt;
&lt;p&gt;S...&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9593127</link><pubDate>Thu, 07 May 2009 11:24:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9593127</guid><dc:creator>Magnus</dc:creator><description>&lt;p&gt;Great little function, thank you O enlightened one :)&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9827486</link><pubDate>Thu, 09 Jul 2009 22:35:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9827486</guid><dc:creator>Dave M</dc:creator><description>&lt;p&gt;Everytime MS comes out with a new browser I have great expectation for it and they never fail to dissapoint. &amp;nbsp;They always make more work for us developers instead of making sure that they are as close to 100% w3 standards compliant, javascript compliant, and just compliant. &amp;nbsp;We are at the breaking point of not supporting any IE browsers any more because of all the hassle.&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9831100</link><pubDate>Mon, 13 Jul 2009 09:04:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9831100</guid><dc:creator>gisardo</dc:creator><description>&lt;p&gt;Dave, IE8 is W3C compliant with HTML 4 and CSS 2.1. It's more compliant than any other browser! Is there anything in particular you think it should behave in a different way in IE8? I'm happy to discuss openly on existing issues, as long as the conversation is constructive and it's not based on browser religions or bad assumptions :-)&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9861481</link><pubDate>Sat, 08 Aug 2009 19:18:21 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9861481</guid><dc:creator>SafetyMan</dc:creator><description>&lt;p&gt;Thanks for the code, Now I have another question. &amp;nbsp;Since my original javascript code to detect IE 8 was wrong how do I know my detection for Windows 7 is correct. &amp;nbsp;To note: I do not have a computer which has windows 7 on it now to test this. &amp;nbsp;I have also search the web and could not find anything good.&lt;/p&gt;
&lt;p&gt;Here is the code I have so far:&lt;/p&gt;
&lt;p&gt;var OSName=&amp;quot;Unknown OS&amp;quot;;&lt;/p&gt;
&lt;p&gt;var OS = navigator.appVersion;&lt;/p&gt;
&lt;p&gt;if (!ie) &lt;/p&gt;
&lt;p&gt;	{&lt;/p&gt;
&lt;p&gt;	//document.write(&amp;quot;THIS IS NOT IE&amp;quot;);&lt;/p&gt;
&lt;p&gt;	OS = navigator.userAgent;&lt;/p&gt;
&lt;p&gt;	}&lt;/p&gt;
&lt;p&gt;if (OS.indexOf(&amp;quot;Win&amp;quot;)!=-1) {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if ((OS.indexOf(&amp;quot;Windows NT 5.1&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;Windows XP&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win XP&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows NT 7.0&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win 7&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows NT 6.0&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win Vista/Server 08&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if (OS.indexOf(&amp;quot;Windows ME&amp;quot;)!=-1)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win ME&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows NT 4.0&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;WinNT4.0&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;WinNT&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win NT&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows NT 5.2&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win Server 03&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows NT 5.0&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;Windows 2000&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win 2000&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows 98&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;Win98&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win 98&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Windows 95&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;Win95&amp;quot;)!=-1) || (OS.indexOf(&amp;quot;Windows_95&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win 95&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ((OS.indexOf(&amp;quot;Win16&amp;quot;)!=-1))&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win 3.1&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else&lt;/p&gt;
&lt;p&gt; &amp;nbsp; OSName=&amp;quot;Win Ver. Unknown&amp;quot;;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (OS.indexOf(&amp;quot;WOW64&amp;quot;)!=-1) OSName=OSName+&amp;quot;(x64)&amp;quot;&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else OSName=OSName+&amp;quot;(x32)&amp;quot;&lt;/p&gt;
&lt;p&gt; }&lt;/p&gt;
&lt;p&gt;else if (OS.indexOf(&amp;quot;Mac&amp;quot;)!=-1) OSName=&amp;quot;MacOS&amp;quot;;&lt;/p&gt;
&lt;p&gt;else if (OS.indexOf(&amp;quot;X11&amp;quot;)!=-1) OSName=&amp;quot;UNIX&amp;quot;;&lt;/p&gt;
&lt;p&gt;else if (OS.indexOf(&amp;quot;Linux&amp;quot;)!=-1) OSName=&amp;quot;Linux&amp;quot;;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Doug Lubey of Louisiana&lt;/p&gt;
&lt;p&gt;www.douglubey.com&lt;/p&gt;
&lt;p&gt;Reference: &lt;/p&gt;
&lt;p&gt;how to detect operating system with Javascript&lt;/p&gt;
&lt;p&gt;Javascript code to detect OS&lt;/p&gt;
&lt;p&gt;Any help would be appreciated&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9861486</link><pubDate>Sat, 08 Aug 2009 19:28:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9861486</guid><dc:creator>Giorgio Sardo</dc:creator><description>&lt;p&gt;Hi Doug,&lt;/p&gt;
&lt;p&gt;if the OS is Windows 7, the userAgent will contain &lt;/p&gt;
&lt;p&gt;the new Windows NT token: Windows NT 6.1.&lt;/p&gt;
&lt;p&gt;Check out this post for more information:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx"&gt;http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;-Giorgio&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9861488</link><pubDate>Sat, 08 Aug 2009 19:31:27 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9861488</guid><dc:creator>SafetyMan</dc:creator><description>&lt;p&gt;I may have found it on this website.&lt;/p&gt;
&lt;p&gt;It did not come right out say &amp;quot;here is the code&amp;quot;&lt;/p&gt;
&lt;p&gt;But it did say&lt;/p&gt;
&lt;p&gt;The major version for windows 7 =6&lt;/p&gt;
&lt;p&gt;And the minor version for windows 7 = 1&lt;/p&gt;
&lt;p&gt;or add this javascript code:&lt;/p&gt;
&lt;p&gt; || (OS.indexOf(&amp;quot;Windows NT 6.1&amp;quot;)!=-1)) &lt;/p&gt;
&lt;p&gt;to the windows 7 detection line.&lt;/p&gt;
&lt;p&gt;OF COURSE I STILL HAVE NO WAY TO TEST THIS....&lt;/p&gt;
&lt;p&gt;PLEASE HELP.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;doug lubey of louisiana&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9861496</link><pubDate>Sat, 08 Aug 2009 19:40:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9861496</guid><dc:creator>Giorgio Sardo</dc:creator><description>&lt;p&gt;As I've written in the previous answer, that is correct.&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9861497</link><pubDate>Sat, 08 Aug 2009 19:40:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9861497</guid><dc:creator>Giorgio Sardo</dc:creator><description>&lt;p&gt;As I've written in the previous answer, that is correct.&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9871433</link><pubDate>Sun, 16 Aug 2009 10:32:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9871433</guid><dc:creator>tiffany</dc:creator><description>&lt;p&gt; I've written in the previous answer, that is correct.&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9891304</link><pubDate>Fri, 04 Sep 2009 12:55:31 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9891304</guid><dc:creator>ghd straighteners</dc:creator><description>&lt;p&gt;nice blog! Really worth reading!!!&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9894732</link><pubDate>Mon, 14 Sep 2009 00:57:45 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894732</guid><dc:creator>Fabien</dc:creator><description>&lt;p&gt;I tried the following code for an alternate style sheet under IE8 (tried on XP) another under previous IE versions and the last for all other navigators and it doesn't work.&lt;/p&gt;
&lt;p&gt;it returns the alert message -1 when i'm under IE8&lt;/p&gt;
&lt;p&gt;here is the code:&lt;/p&gt;
&lt;p&gt;function getInternetExplorerVersion()&lt;/p&gt;
&lt;p&gt;// Returns the version of Internet Explorer or a -1&lt;/p&gt;
&lt;p&gt;// (indicating the use of another browser).&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;var rv = -1; // Return value assumes failure.&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if (navigator.appName == 'Microsoft Internet Explorer')&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var ua = navigator.userAgent;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;var re &amp;nbsp;= new RegExp(&amp;quot;MSIE ([0-9]{1,}[\.0-9]{0,})&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;if (re.exec(ua) != null)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;rv = parseFloat( RegExp.$1 );&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;return rv;&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;var ver = getInternetExplorerVersion();&lt;/p&gt;
&lt;p&gt; &amp;nbsp;if ( ver = -1 ) &lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;document.write(&amp;quot;&amp;lt;link rel='stylesheet' href='css/vcod.css' type='text/css'&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;alert (ver);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if (( ver &amp;gt; -1 ) &amp;nbsp;&amp;amp;&amp;amp; ( ver &amp;lt; 8.0 ))&lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;document.write(&amp;quot;&amp;lt;link rel='stylesheet' href='css/vcod_IE.css' type='text/css'&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;alert (ver);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp;else if ( ver &amp;gt;= 8.0 ) &lt;/p&gt;
&lt;p&gt; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp;alert (ver);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;document.write(&amp;quot;&amp;lt;link rel='stylesheet' href='css/vcod_IE8.css' type='text/css'&amp;gt;&amp;quot;);&lt;/p&gt;
&lt;p&gt; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;help may be useful&lt;/p&gt;
</description></item><item><title>re: How to detect IE8 using JavaScript (Client side)</title><link>http://blogs.msdn.com/giorgio/archive/2009/04/14/how-to-detect-ie8-using-javascript-client-side.aspx#9916538</link><pubDate>Tue, 03 Nov 2009 02:58:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9916538</guid><dc:creator>buy fallen earth chips</dc:creator><description>&lt;p&gt;the function is very hard for me, i understand it hardly. i will come here every day!&lt;/p&gt;
</description></item></channel></rss>