Reputation: 22684
I have a script which removes items from an input with CSV. It works except in Explorer
What could be the cause? I can't figure it out... !
Upvotes: 3
Views: 313
Reputation: 22220
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);
...
Upvotes: 3