| Issue 4: | Class.js Internet Explorer problem with indexOf |
1 of 3
Next ›
|
| 1 person starred this issue and may be notified of changes. | Back to list |
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. |
|
,
May 28, 2009
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<this.length; i++){
if(this[i]==obj){
return i;
}
}
return -1;
}
}
|
|
|
|