<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Detecting IE7+ in JavaScript</title>
	<atom:link href="http://ajaxian.com/archives/detecting-ie7-in-javascript/feed" rel="self" type="application/rss+xml" />
	<link>http://ajaxian.com/archives/detecting-ie7-in-javascript</link>
	<description>Cleaning up the web with Ajax</description>
	<lastBuildDate>Thu, 17 May 2012 07:43:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>By: anshulabhinav</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-267443</link>
		<dc:creator>anshulabhinav</dc:creator>
		<pubDate>Wed, 17 Sep 2008 09:08:24 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-267443</guid>
		<description>I&#039;m using two javascript methods inside and html page and trying to run that page in IE7 but its is giving JavaScript syntax error. Can you help whts wrong here..?


function validateRow()
      {
        var desc=document.getElementById(&quot;desc&quot;); 
        var trimDesc=Trim(desc.value);
        if((trimDesc==null) &#124;&#124; (trimDesc==&#039;&#039;))
        {
          alert(&#039;The RoutePlan must have a description&#039;);
          flag=false;
          return flag;
        }
        return true;
      }
      


function Trim(str)
      {  while(str.charAt(0) == (&quot; &quot;) )
        {  str = str.substring(1);
        }
        while(str.charAt(str.length-1) == &quot; &quot; )
        {  str = str.substring(0,str.length-1);
        }
        return str;
      }</description>
		<content:encoded><![CDATA[<p>I&#8217;m using two javascript methods inside and html page and trying to run that page in IE7 but its is giving JavaScript syntax error. Can you help whts wrong here..?</p>
<p>function validateRow()<br />
      {<br />
        var desc=document.getElementById(&#8220;desc&#8221;);<br />
        var trimDesc=Trim(desc.value);<br />
        if((trimDesc==null) || (trimDesc==&#8221;))<br />
        {<br />
          alert(&#8216;The RoutePlan must have a description&#8217;);<br />
          flag=false;<br />
          return flag;<br />
        }<br />
        return true;<br />
      }</p>
<p>function Trim(str)<br />
      {  while(str.charAt(0) == (&#8221; &#8220;) )<br />
        {  str = str.substring(1);<br />
        }<br />
        while(str.charAt(str.length-1) == &#8221; &#8221; )<br />
        {  str = str.substring(0,str.length-1);<br />
        }<br />
        return str;<br />
      }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FredCK</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-260338</link>
		<dc:creator>FredCK</dc:creator>
		<pubDate>Wed, 02 Jan 2008 17:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-260338</guid>
		<description>In the above code:

var s = navigator.userAgent.toLowerCase();</description>
		<content:encoded><![CDATA[<p>In the above code:</p>
<p>var s = navigator.userAgent.toLowerCase();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FredCK</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-260337</link>
		<dc:creator>FredCK</dc:creator>
		<pubDate>Wed, 02 Jan 2008 17:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-260337</guid>
		<description>@Robin: correct. Our final beast:

var isIE7 = /*@cc_on!@*/false &amp;&amp; ( parseInt( s.match( /msie (\d+)/ )[1] ) &gt;= 7 );</description>
		<content:encoded><![CDATA[<p>@Robin: correct. Our final beast:</p>
<p>var isIE7 = /*@cc_on!@*/false &amp;&amp; ( parseInt( s.match( /msie (\d+)/ )[1] ) &gt;= 7 );</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-260051</link>
		<dc:creator>Robin</dc:creator>
		<pubDate>Mon, 17 Dec 2007 10:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-260051</guid>
		<description>The trouble with the JScript detection ideas is that the JScript version is independent of browser version.</description>
		<content:encoded><![CDATA[<p>The trouble with the JScript detection ideas is that the JScript version is independent of browser version.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FredCK</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-259822</link>
		<dc:creator>FredCK</dc:creator>
		<pubDate>Sat, 08 Dec 2007 08:28:11 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-259822</guid>
		<description>&lt;code&gt;
var isIE7 = /*@cc_on@if(@_jscript_version&gt;=5.7)!@end@*/false;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code><br />
var isIE7 = /*@cc_on@if(@_jscript_version&gt;=5.7)!@end@*/false;<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jim</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-259361</link>
		<dc:creator>Jim</dc:creator>
		<pubDate>Tue, 27 Nov 2007 18:25:46 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-259361</guid>
		<description>var ie = /*@cc_on (@_jscript_version </description>
		<content:encoded><![CDATA[<p>var ie = /*@cc_on (@_jscript_version </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Valentin</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-256345</link>
		<dc:creator>Valentin</dc:creator>
		<pubDate>Tue, 02 Oct 2007 06:36:08 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-256345</guid>
		<description>&lt;code&gt;var Browser=new(
  var w=window;
  var d=w.document;
  var ua=navigator.userAgent.toLowerCase();
  this.ie = w.VBArray;
  this.ie5=(this.ie &amp;&amp; (!d.createEventObject &#124;&#124; !d.namespaces));
  this.ie55=(this.ie &amp;&amp; !d.implementation);
  this.ie6=(this.ie &amp;&amp; d.implementation);
  this.ie7 = (this.ie &amp;&amp; w.XMLHttpRequest);
  this.opera = w.opera;
  this.gecko = (w.netscape &amp;&amp; !this. opera);
  this.khtml=(ua.indexOf(&quot;safari&quot;)+1 &#124;&#124; ua.indexOf(&quot;konqueror&quot;)+1);
)()&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code>var Browser=new(<br />
  var w=window;<br />
  var d=w.document;<br />
  var ua=navigator.userAgent.toLowerCase();<br />
  this.ie = w.VBArray;<br />
  this.ie5=(this.ie &amp;&amp; (!d.createEventObject || !d.namespaces));<br />
  this.ie55=(this.ie &amp;&amp; !d.implementation);<br />
  this.ie6=(this.ie &amp;&amp; d.implementation);<br />
  this.ie7 = (this.ie &amp;&amp; w.XMLHttpRequest);<br />
  this.opera = w.opera;<br />
  this.gecko = (w.netscape &amp;&amp; !this. opera);<br />
  this.khtml=(ua.indexOf("safari")+1 || ua.indexOf("konqueror")+1);<br />
)()</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Buddy Logan</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-249641</link>
		<dc:creator>Buddy Logan</dc:creator>
		<pubDate>Fri, 20 Apr 2007 14:27:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-249641</guid>
		<description>This always works for me:
version=0;
if(navigator.appName.indexOf(&quot;Internet Explorer&quot;) != -1)
{
   temp=navigator.appVersion.split(&quot;MSIE&quot;);
   version=parseFloat(temp[1]);
}
if (version == 0) //NON IE browser will return 0
{code}
if (version == 6)
{code}
etc.</description>
		<content:encoded><![CDATA[<p>This always works for me:<br />
version=0;<br />
if(navigator.appName.indexOf(&#8220;Internet Explorer&#8221;) != -1)<br />
{<br />
   temp=navigator.appVersion.split(&#8220;MSIE&#8221;);<br />
   version=parseFloat(temp[1]);<br />
}<br />
if (version == 0) //NON IE browser will return 0<br />
{code}<br />
if (version == 6)<br />
{code}<br />
etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shaun Inman</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-249390</link>
		<dc:creator>Shaun Inman</dc:creator>
		<pubDate>Fri, 13 Apr 2007 17:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-249390</guid>
		<description>Not sure that last one is the way to go. My IE7 beta @_jscript_build is 5700 and my IE 6 is 8820. Really shouldn&#039;t be branching code based on version anyways. Object detection (when you need to use the actual object, not as proposed in the examples here) is really the only way to be safe.</description>
		<content:encoded><![CDATA[<p>Not sure that last one is the way to go. My IE7 beta @_jscript_build is 5700 and my IE 6 is 8820. Really shouldn&#8217;t be branching code based on version anyways. Object detection (when you need to use the actual object, not as proposed in the examples here) is really the only way to be safe.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stef</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-249328</link>
		<dc:creator>Stef</dc:creator>
		<pubDate>Thu, 12 Apr 2007 08:23:52 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-249328</guid>
		<description>Try this one:
var isIE7 = false;
/*@cc_on
@if (@_jscript_build &gt;= 8832)
isIE7 = true;
@end
@*/</description>
		<content:encoded><![CDATA[<p>Try this one:<br />
var isIE7 = false;<br />
/*@cc_on<br />
@if (@_jscript_build &gt;= 8832)<br />
isIE7 = true;<br />
@end<br />
@*/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Kelly</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-247922</link>
		<dc:creator>Will Kelly</dc:creator>
		<pubDate>Fri, 09 Mar 2007 13:07:05 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-247922</guid>
		<description>If you are using a Javascript library, thereâ€™s a chance that the XMLHttpRequest object has been automatically added. I doubt Abeâ€™s method would be added by a library so use that instead.</description>
		<content:encoded><![CDATA[<p>If you are using a Javascript library, thereâ€™s a chance that the XMLHttpRequest object has been automatically added. I doubt Abeâ€™s method would be added by a library so use that instead.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Max</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-247446</link>
		<dc:creator>Max</dc:creator>
		<pubDate>Thu, 22 Feb 2007 04:11:54 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-247446</guid>
		<description>May be of some interest..?

http://www.java-scripts.net/javascripts/Knock-Knock!-Browser-Check.phtml</description>
		<content:encoded><![CDATA[<p>May be of some interest..?</p>
<p><a href="http://www.java-scripts.net/javascripts/Knock-Knock!-Browser-Check.phtml" rel="nofollow">http://www.java-scripts.net/javascripts/Knock-Knock!-Browser-Check.phtml</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Pate</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-246858</link>
		<dc:creator>Jamie Pate</dc:creator>
		<pubDate>Sat, 03 Feb 2007 03:12:26 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-246858</guid>
		<description>Btw, I settled with the obvious 
var result = navigator.appVersion.indexOf(&#039;MSIE&#039;) &gt; -1;
(should be fine as long as no other browsers set their navigator.appVersion to contain &#039;MSIE&#039; (why would they do that))</description>
		<content:encoded><![CDATA[<p>Btw, I settled with the obvious<br />
var result = navigator.appVersion.indexOf(&#8216;MSIE&#8217;) &gt; -1;<br />
(should be fine as long as no other browsers set their navigator.appVersion to contain &#8216;MSIE&#8217; (why would they do that))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Pate</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-246857</link>
		<dc:creator>Jamie Pate</dc:creator>
		<pubDate>Sat, 03 Feb 2007 03:06:15 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-246857</guid>
		<description>the conditional compiling stopped working on me, it worked fine on my intranet server, but when I put it on the internet it stopped detecting properly (security zone setting?)</description>
		<content:encoded><![CDATA[<p>the conditional compiling stopped working on me, it worked fine on my intranet server, but when I put it on the internet it stopped detecting properly (security zone setting?)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhilasha Sharma</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-246655</link>
		<dc:creator>Abhilasha Sharma</dc:creator>
		<pubDate>Mon, 29 Jan 2007 21:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-246655</guid>
		<description>//If script is executed width , then document.body is not available yet.

if (window.XMLHttpRequest) {
if(document.all){
document.write(&quot;IE 7&quot;);
//IE7
}else{
document.write(&quot;Mozilla&quot;);
//mozilla, safari, opera 9â€¦etc
}
} else {
document.write(&quot;IE 6&quot;);
// IE6, older browsers
} 

This works perfectly as welll...</description>
		<content:encoded><![CDATA[<p>//If script is executed width , then document.body is not available yet.</p>
<p>if (window.XMLHttpRequest) {<br />
if(document.all){<br />
document.write(&#8220;IE 7&#8243;);<br />
//IE7<br />
}else{<br />
document.write(&#8220;Mozilla&#8221;);<br />
//mozilla, safari, opera 9â€¦etc<br />
}<br />
} else {<br />
document.write(&#8220;IE 6&#8243;);<br />
// IE6, older browsers<br />
} </p>
<p>This works perfectly as welll&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lbordea</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-246544</link>
		<dc:creator>Lbordea</dc:creator>
		<pubDate>Thu, 25 Jan 2007 15:38:16 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-246544</guid>
		<description>I have tried:


isIE7 = true;


it did not work - everytime isIE7 was true even in IE6 :(

I tried:
isIE7 = false;
/* @cc_on
  @if (@_jscript_version &gt;= 5.7)
    isIE7 = true;
  @end
@*/

no good - does not work in IE7 :(.
The final solution is??!!!??</description>
		<content:encoded><![CDATA[<p>I have tried:</p>
<p>isIE7 = true;</p>
<p>it did not work &#8211; everytime isIE7 was true even in IE6 :(</p>
<p>I tried:<br />
isIE7 = false;<br />
/* @cc_on<br />
  @if (@_jscript_version &gt;= 5.7)<br />
    isIE7 = true;<br />
  @end<br />
@*/</p>
<p>no good &#8211; does not work in IE7 :(.<br />
The final solution is??!!!??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-213610</link>
		<dc:creator>Ben</dc:creator>
		<pubDate>Mon, 27 Nov 2006 19:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-213610</guid>
		<description>@DannyB:

I think the proper code is this:
&lt;code&gt;
isIE7 = false;
/* @cc_on
&#160;&#160;@if (@_jscript_version &gt;= 5.7)
&#160;&#160;&#160;&#160;isIE7 = true;
&#160;&#160;@end
@*/ 
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@DannyB:</p>
<p>I think the proper code is this:<br />
<code><br />
isIE7 = false;<br />
/* @cc_on<br />
&nbsp;&nbsp;@if (@_jscript_version &gt;= 5.7)<br />
&nbsp;&nbsp;&nbsp;&nbsp;isIE7 = true;<br />
&nbsp;&nbsp;@end<br />
@*/<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sara</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-188544</link>
		<dc:creator>Sara</dc:creator>
		<pubDate>Thu, 16 Nov 2006 22:25:57 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-188544</guid>
		<description>I&#039;ve been looking all over for something like this. A site I just launched: www.syndicate-cycle.com was written for IE7. Many of the customers that view the site are IE users. The page works but looks bad in IE6. I want IE6 and below users to see a warning page and then allow them to either upgrade or continue to the site. This code will probably work for me except it&#039;s only a snippet and I don&#039;t know how to program it fully to make it work. Can someone finish the code so I can implement it? THANKS!
sara</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been looking all over for something like this. A site I just launched: <a href="http://www.syndicate-cycle.com" rel="nofollow">http://www.syndicate-cycle.com</a> was written for IE7. Many of the customers that view the site are IE users. The page works but looks bad in IE6. I want IE6 and below users to see a warning page and then allow them to either upgrade or continue to the site. This code will probably work for me except it&#8217;s only a snippet and I don&#8217;t know how to program it fully to make it work. Can someone finish the code so I can implement it? THANKS!<br />
sara</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DannyB</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-185664</link>
		<dc:creator>DannyB</dc:creator>
		<pubDate>Wed, 15 Nov 2006 18:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-185664</guid>
		<description>You could use conditional compilation...  untested but should work...

isIE7 = false;
/*@cc_on
&#160;&#160;&#160;@if (@_jscript_version == 7)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;isIE7 = true;
&#160;&#160;&#160;@end
@*/</description>
		<content:encoded><![CDATA[<p>You could use conditional compilation&#8230;  untested but should work&#8230;</p>
<p>isIE7 = false;<br />
/*@cc_on<br />
&nbsp;&nbsp;&nbsp;@if (@_jscript_version == 7)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isIE7 = true;<br />
&nbsp;&nbsp;&nbsp;@end<br />
@*/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cheapest xenical online</title>
		<link>http://ajaxian.com/archives/detecting-ie7-in-javascript/comment-page-1#comment-177563</link>
		<dc:creator>cheapest xenical online</dc:creator>
		<pubDate>Sat, 11 Nov 2006 16:37:10 +0000</pubDate>
		<guid isPermaLink="false">http://ajaxian.com/archives/detecting-ie7-in-javascript#comment-177563</guid>
		<description>&lt;strong&gt;cheapest xenical online&lt;/strong&gt;

 buy xenical online &#124; xenical review &#124; xenical australia &#124; cheapest xenical online &#124; xenical scam xen001xenxen1 </description>
		<content:encoded><![CDATA[<p><strong>cheapest xenical online</strong></p>
<p> buy xenical online | xenical review | xenical australia | cheapest xenical online | xenical scam xen001xenxen1 </p>
]]></content:encoded>
	</item>
</channel>
</rss>

