<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Detecting IE7+ in Javascript</title>
	<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/</link>
	<description>The latest on Abe's work</description>
	<pubDate>Fri, 25 Jul 2008 15:59:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Johann</title>
		<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-80983</link>
		<author>Johann</author>
		<pubDate>Thu, 25 Oct 2007 11:03:30 +0000</pubDate>
		<guid>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-80983</guid>
		<description>This approach is problematic in that it accesses document.body which isn't available in the head section.

What I use today is something like this:

var md = window.showModelessDialog; /* Win 5+, WinCE 5.5+ */
var ns = document.namespaces; /* Win 5.5+, WinCE 5.5+ */
var im = document.implementation; /* Win 6, Mozilla */

var isIE = typeof window.external != 'unknown' &#38;&#38; (md &#124;&#124; ns &#124;&#124; im);
var isIE50 = md &#38;&#38; !ns &#38;&#38; !im;
var isIE55 = md &#38;&#38; ns &#38;&#38; !im;
var isIE60 = md &#38;&#38; ns &#38;&#38; im;

So maybe I would check for IE 7 with

var isIE7 = md &#38;&#38; ns &#38;&#38; im &#38;&#38; window.ActiveXObject;</description>
		<content:encoded><![CDATA[<p>This approach is problematic in that it accesses document.body which isn&#8217;t available in the head section.</p>
<p>What I use today is something like this:</p>
<p>var md = window.showModelessDialog; /* Win 5+, WinCE 5.5+ */<br />
var ns = document.namespaces; /* Win 5.5+, WinCE 5.5+ */<br />
var im = document.implementation; /* Win 6, Mozilla */</p>
<p>var isIE = typeof window.external != &#8216;unknown&#8217; &amp;&amp; (md || ns || im);<br />
var isIE50 = md &amp;&amp; !ns &amp;&amp; !im;<br />
var isIE55 = md &amp;&amp; ns &amp;&amp; !im;<br />
var isIE60 = md &amp;&amp; ns &amp;&amp; im;</p>
<p>So maybe I would check for IE 7 with</p>
<p>var isIE7 = md &amp;&amp; ns &amp;&amp; im &amp;&amp; window.ActiveXObject;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darren</title>
		<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-80065</link>
		<author>Darren</author>
		<pubDate>Mon, 22 Oct 2007 22:02:39 +0000</pubDate>
		<guid>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-80065</guid>
		<description>Actually tom I think I read somewhere that Microsoft released an update for IE6 to bring it up to jscript version 5.7 so this detection won't work!  Typical Microsoft! (throws hands up in despair)</description>
		<content:encoded><![CDATA[<p>Actually tom I think I read somewhere that Microsoft released an update for IE6 to bring it up to jscript version 5.7 so this detection won&#8217;t work!  Typical Microsoft! (throws hands up in despair)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-7240</link>
		<author>tom</author>
		<pubDate>Wed, 03 Jan 2007 02:14:08 +0000</pubDate>
		<guid>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-7240</guid>
		<description>actually, since IE7 ups the jscript version to 5.7 now, you can actually detect the specific engine version using condition compliation and the @_jscript_version flag. that is sure-fire detection for IE7, since jscript 5.7 is not available to older versions of IE.</description>
		<content:encoded><![CDATA[<p>actually, since IE7 ups the jscript version to 5.7 now, you can actually detect the specific engine version using condition compliation and the @_jscript_version flag. that is sure-fire detection for IE7, since jscript 5.7 is not available to older versions of IE.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony Bianco</title>
		<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-4101</link>
		<author>Tony Bianco</author>
		<pubDate>Thu, 16 Nov 2006 23:42:12 +0000</pubDate>
		<guid>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-4101</guid>
		<description>Acutally there is conditional comments for JavaScript called Conditional Compilation. I would much rather use straight up JavaScript to test for the features but the nice thing about Conditional Compilation is that you can detect to the exact browser version for IE. I think it's a bit sloppy and that JavaScript feature sniffing is a more streamline approach but it sure does help to have that one more tool in your belt.

really quick... if I only want something to show for IE 7 and I'm sniffing for features how would I nail it down to just IE 7. Would I test this:

if(window.XMLHttpRequest)
{
   if(window.ActiveXObject)
   {
      // IE 7
   }
   else
   {
      // Opera, Safari, Firefox
   }
}
else
{
   //IE 6 and below
}

Here's the link for the conditional compilation:
http://www.javascriptkit.com/javatutors/conditionalcompile.shtml


Cheers!
- Tony</description>
		<content:encoded><![CDATA[<p>Acutally there is conditional comments for JavaScript called Conditional Compilation. I would much rather use straight up JavaScript to test for the features but the nice thing about Conditional Compilation is that you can detect to the exact browser version for IE. I think it&#8217;s a bit sloppy and that JavaScript feature sniffing is a more streamline approach but it sure does help to have that one more tool in your belt.</p>
<p>really quick&#8230; if I only want something to show for IE 7 and I&#8217;m sniffing for features how would I nail it down to just IE 7. Would I test this:</p>
<p>if(window.XMLHttpRequest)<br />
{<br />
   if(window.ActiveXObject)<br />
   {<br />
      // IE 7<br />
   }<br />
   else<br />
   {<br />
      // Opera, Safari, Firefox<br />
   }<br />
}<br />
else<br />
{<br />
   //IE 6 and below<br />
}</p>
<p>Here&#8217;s the link for the conditional compilation:<br />
<a href="http://www.javascriptkit.com/javatutors/conditionalcompile.shtml" rel="nofollow">http://www.javascriptkit.com/javatutors/conditionalcompile.shtml</a></p>
<p>Cheers!<br />
- Tony</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ckm@NTHU - Blog &#187; 每日網摘 (多日補齊)</title>
		<link>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-2609</link>
		<author>ckm@NTHU - Blog &#187; 每日網摘 (多日補齊)</author>
		<pubDate>Sun, 15 Oct 2006 15:47:29 +0000</pubDate>
		<guid>http://fettig.net/weblog/2006/10/09/detecting-ie7-in-javascript/#comment-2609</guid>
		<description>[...] Abe Fettig’s Weblog » Detecting IE7+ in Javascript 如何辨識 IE7 的 JavaScript 語法～ [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] Abe Fettig’s Weblog » Detecting IE7+ in Javascript 如何辨識 IE7 的 JavaScript 語法～ [&#8230;]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
