Put the code below at the top of your javascript file, after $(document).ready(function() {....}).
//if browser does not support Array.indexOf() method (IE8 and IE9) //use jQuery.inArray() method instead if (!Array.prototype.indexOf) { Array.prototype.indexOf = function(val) { return jQuery.inArray(val, this); }; }
This works perfect if you want to keep using the indexOf() function. This code provides a fallback for your site visitors who are using IE 8 and older browsers that does not support the Javascript indexOf() function for Array.
No comments:
Post a Comment