I am facing issue with indexOf() of JavaScript with array values.
below given code is not working IE 7, 8
e.g.
var wildcards2 = ['test1', 'test2'];
var test = wildcards2.indexOf('test2');
alert(test);
but working fine in Mozila
After this result, there is ajax request in may page.
But just because it is not working so , page get submitted instead of sending ajax request.
indexOfforArrayobjects was added in JavaScript 1.6 but IE 7 and 8’s JS implementations are closer to JavaScript 1.5 and they do not supportindexOf.The MDN documentation for
indexOfincludes a compatibility routine that you can copy/paste.Alternatively, some libraries implement helper functions to provide similar functionality, and you can use them:
indexOffrom the YUI 3 array moduleinArray