• Increase font size
  • Default font size
  • Decrease font size

Array.indexOf does not work in Internet Explorer

While trying to do an indexOf on a Javascript array I discovered that it wouldn't work in Internet Explorer!

IE does not support this method for array's! So A quick search on the web lead me to soledad penedés web site where I discovered a simple solution. All you have to do is add the following chunk of code to your script with no modifications and it will force Internet Explorer to function properly! How cool is that!

<code title="Array.indexOf() JavaScript">if(!Array.indexOf){
 Array.prototype.indexOf = function(obj){
 for(var i=0; i<this.length; i++){
 if(this[i]==obj){
 return i;
 }
 }
 return -1;
 }
}</code>

 

Comments  

 
0 #3 prestamos si 2017-04-03 13:13
En cuanto al importe máximo y al plazo de los anticipos,
pueden variar dependiendo de las condiciones ofrecidas por la entidad y de nuestro propio perfil económico.
Quote
 
 
0 #2 wevibe3, 2014-12-11 18:31
Great post. I was checking continuously this blog
and I am inspired! Very useful information specially
the remaining section :) I handle such information a lot.

I used to be looking for this certain info for a long
time. Thank you and best of luck.
Quote
 
 
0 #1 sex shop Marbella 2014-12-11 00:45
Howdy! Would you mind if I share your blog with my facebook group?

There's a lot of folks that I think would really enjoy your content.
Please let me know. Cheers
Quote
 

Add comment

No bad words.


Security code
Refresh


Design by i-cons.ch / etosha-namibia.ch