Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery click() function doesn't work in Internet Explorer

I have a script which removes items from an input with CSV. It works except in Explorer

http://jsfiddle.net/BXWqK/21/

What could be the cause? I can't figure it out... !

like image 793
CyberJunkie Avatar asked Jan 28 '26 22:01

CyberJunkie


1 Answers

I suppose you're talking about older versions of Internet Explorer (the newer version being 9, and your script works on it).

Then it's probably because of Array.indexOf, Internet Explorer used to not have that function. See Array.indexOf in Internet Explorer.

By the way, jQuery.inArray also returns the value's index within the array. So doing this is pretty redundant:

if ($.inArray(fruit_remove, fruits_array) > -1) {
   var fruit_index = fruits_array.indexOf(fruit_remove);
   ...
like image 143
Bertrand Marron Avatar answered Jan 30 '26 13:01

Bertrand Marron



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!