Export to GitHub

digg - issue #4

Class.js Internet Explorer problem with indexOf


Posted on May 28, 2009 by Quick Hippo

I use the class.js to create OO Classes in jQuery.

I have a problem with Internet Explorer. When i see the code, i see that there is a call that uses indexOf to search inside an array. IndexOf is not supported by InternetExplorer.

This must by fixed in order to make the class cross-browsers.

Comment #1

Posted on May 28, 2009 by Helpful Kangaroo

You need to add this JavaScript code to add indexOf functionality to IE6 (extending Array class):

if(!Array.indexOf){ Array.prototype.indexOf = function(obj){ for(var i=0; i

Comment #2

Posted on Aug 13, 2010 by Massive Elephant

Hm i dont know the class.js is still in development but jQuery.inArray makes the save as Array.indexOf

Replace: ['namespace','create','sup'].indexOf(i) with: $.inArray(i, ['namespace','create','sup'])

Status: New

Labels:
Type-Defect Priority-Medium