Do we still need to check for different browser types in JavaScript?
<p>This is probably a simple question, and I'm slightly embarrassed to ask it, but I've been working with this chunk of JavaScript ad code for a while and it's bothered me that it's never really made sense to me and is probably out dated now with modern browsers. My question is, do we need to check for browser types still, and what is that second bit of script doing?</p>

<pre><code>&lt;script type="text/javascript"&gt;
  document.write('&lt;scr' + 'ipt src="" type="text/javascript"&gt;&lt;/scr' + 'ipt&gt;');
&lt;/script&gt;
&lt;script type="text/javascript"&gt;
  if ((!document.images &amp;&amp; navigator.userAgent.indexOf('Mozilla/2.') &gt;= 0)  || navigator.userAgent.indexOf("WebTV")&gt;= 0) {
    document.write('&lt;a href=""&gt;');
    document.write('&lt;img src="" border="0" alt="" /&gt;&lt;/a&gt;');
  }
&lt;/script&gt;
</code></pre>

<p>I'd like to clarify that I'm actually calling someone some ad code, so while I could check for browser types, that would really be the responsibility of the keeper of the code. I'd love it if I could get this into jQuery - but I'm having trouble with the call (see my other post below).</p>

<p>What I was wondering is, do I still need to check for these browser types?</p>

<p>Cheers,<br />
Steve</p>
