CyberJunkie
CyberJunkie

Reputation: 22684

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... !

Upvotes: 3

Views: 313

Answers (1)

Bertrand Marron
Bertrand Marron

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

Related Questions