Why does this javascript not work in IE but works in other browsers?
<p>Yet another reason why I hate IE for being different. I've got this code:</p>

<pre><code>var friends = document.getElementById('friendsEmail').value;
...
 var emailArray=new Array();
 emailArray=String(friends).split(','); //error here
</code></pre>

<p>This works in every other browser. In fact I only added the <code>Array</code> declaration and the explicit <code>String</code> conversion to get this to work in IE. However, I'm still getting this error</p>

<blockquote>
  <p><strong>Webpage error details</strong></p>
  
  <p>User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1;
  Trident/4.0; .NET4.0C; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152;
  .NET CLR 3.5.30729; .NET4.0E; .NET CLR 1.1.4322) Timestamp: Wed, 1 Feb
  2012 22:24:15 UTC</p>
  
  <blockquote>
    <p>Message: Object doesn't support this property or method Line: 59 Char:
    4 Code: 0</p>
  </blockquote>
</blockquote>

<p>What does IE not like about this? Am I doing something obviously stupid that I'm not seeing?</p>

<p><strong>EDIT</strong></p>

<p>This is what I did originally that resulted in IE errors:</p>

<pre><code>var emailArray=friends.split(',');
</code></pre>

<p>This also gives me errors in IE</p>

<p><strong>EDIT 2</strong></p>

<p>I'm sorry guys. Turns out that the server was caching an older copy of the .js file and the error line I was looking at was incorrect... I apologize for wasting your time with this. The error turned out to be on a completely different line. For those who are curious it was actually failing because of this line</p>

<pre><code>emailArray[count]=emailArray[count].trim();
</code></pre>

<p>I've already resolved that issue though.</p>
