I assume you are talking about older versions of Internet Explorer (the newer version is 9, and your script is working on it).
Then, probably because of Array.indexOf, Internet Explorer did not have this feature. See Array.indexOf in Internet Explorer .
By the way, it jQuery.inArrayalso returns the index of the value inside the array. Therefore, doing this is quite difficult:
if ($.inArray(fruit_remove, fruits_array) > -1) {
var fruit_index = fruits_array.indexOf(fruit_remove);
...
source
share