I am using interface in page which is having compatibility problems with another script I am using in the apge. The definition for the Array.indexOf prototype is causing problems in my script with IE6. It may have to do the other script that is running on the same page but either way, if you want the script to be more compatible, here's the fix:
// THAT LAST DEFINITION IN IUTIL.JS: CHANGE THIS
// Helper function to support older browsers!
[].indexOf
(Array.prototype.indexOf = function(v, n){
n = (n == null) ? 0 : n;
var m = this.length;
for (var i=n; i<m; i++)
if (this[i] == v)
return i;
return -1;
});
// TO THIS
// Helper function to support older browsers!
if (![].indexOf) {
Array.prototype.indexOf = function(v, n){
n = (n == null) ? 0 : n;
var m = this.length;
for (var i=n; i<m; i++)
if (this[i] == v)
return i;
return -1;
});
}
After that change, I stopped getting the error.
Attachments
Change History
Download in other formats:
|