I got a note that someone that my sprites didn't work in Opera.  So I fired
up my virtual PC and installed Opera.
jQuery was not the culprit.  The problem was that Opera does not support
indexOf on an array, just on strings.
Info in bottom of this page:
http://www.howtocreate.co.uk/emails/NicolasR.html

I found this, which extends Opera to solve the problem.
Info in middle of this page:
http://www.sitepoint.com/forums/showthread.php?t=318494

Code:
if (!Array.prototype.indexOf) {
    Array.prototype.indexOf = function(val, fromIndex) {
        if (typeof(fromIndex) != 'number') fromIndex = 0;
        for (var index = fromIndex,len = this.length; index < len; index++)
            if (this[index] == val) return index;
        return -1;
    }
}

This immediately fixed the opera problem with no side-effects I can detect.

So my questions are:

   1. Do any plugins depend on indexOf in a way that will not work in
   Opera?
   2. Maybe this snippet of code should be put in jQuery?
   3. Maybe I should post this to the dev list?

Glen

Reply via email to