title: JavaScript indexOf vs Array.prototype.indexOf IE compatibility error
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3629183/why-doesnt-indexof-work-on-an-array-ie8">Why doesn&#39;t indexOf work on an array IE8?</a>  </p>
  </blockquote>
  
  
  
  <p>I recently developed a script that uses native Javascript and jQuery. Most of my development has been with IE 9, Chrome, Firefox. For all of them the line below works perfectly:</p>
  
  <pre><code>if(data.cols.indexOf("footprint") &lt; 0)
  </code></pre>
  
  <p>However today I pushed a bit of my code to a production system and a couple of the clients have come back saying their pages are broken. I have narrowed my search down to <code>indexOf</code>, which apparently IE 8 does not like in the slightest. So I am trying to find an alternative and I found this bit <code>Array.prototype.indexOf</code> but I am not really sure how I would tie that into an if-else similar to above.</p>
  
  <p>Also if there is a better alternative then I am all ears. Also, is this something I may have to apply to IE 8 browsers only, where if IE 8 is found, use this, if not use the original?</p>