Firefox supports indexOf() for arrays, but IE doesn’t (at least IE7 doesn’t). To work around this, write your own version…maybe like this:

function fiArrayContains(ax, xTarget) {

var n;
if (fbIsArray(ax)) {

n = ax.length;
for (i=0; i < n; i++) {

if (ax[i] == xTarget) {

return i;

}

}

}
return -1;

}

function fbIsArray(x) {

return fbIsObject(x) && x.constructor == Array;

}
function
fbIsObject(x) {

return (typeof x == ‘object’ && !!x) || fbIsFunction(x);

}
function
fbIsFunction(x) {

return typeof x == ‘function’;

}

Trackback URL
Leave your own comments about this post:
You must be logged in to post a comment.