pixabay jquery autoComplete not working in IE8

234 views Asked by At

I am using pixabay's jquery autoComplete plugin on this page http://xf.saminaraza.com/order-samples/

It is working fine on most browsers. However the autoComplete isn't working on IE8 despite their demo working fine on IE8.

This is where autoComplete is called:

$('input[id="sample"]').autoComplete({
                minChars: 0,
                source: function(term, suggest){
                    term = term.toLowerCase();
                    var choices = ['Vinyl Flooring  VLVT6051','Vinyl Flooring  VLVT6072','Vinyl Flooring  VLVT6046','Vinyl Flooring  VLVT4045','Vinyl Flooring  VLVT6033','Vinyl Flooring  VLVT6031','Vinyl Flooring  VLVT6022','Vinyl Flooring  VLVT6013','Vinyl Flooring  VLVT6003','Vinyl Flooring  VLVT6001','Urban Click Diamond Creek BE30803893','Urban Click Kapalua BE30503806','Urban Click Olympic BE30403913','Urban Click Hazeltine BE30303698','Urban Click Congressional BE30703863','Urban Click Sugarloaf BE30703798','Urban Click Carnoustie BE30703628','Urban Click Scottsdale BE30703488','Urban Click Avenel BE30703013','Oak  R47','Oak  R46','Oak  R08','Oak  R05','Oak  R04','Oak  R02','Oak  D152401','Mayfair  R33','Mayfair  R29','Mayfair  R28','Mayfair  R27','Mayfair  R26','Richmond Engineered  R48','Richmond Engineered  R24','Richmond Engineered  R23','Richmond Engineered  R22','Richmond Engineered  DCF002','Richmond Engineered  D14014','Richmond Engineered  D14013','Richmond Engineered  D0104','Kensington 189  R42','Kensington 189  R18','Kensington 189  R17','Kensington 189  R16','Kensington 189  R15','Kensington 189  R14','Kensington 189  R13','Kensington 189  R12','Kensington 189  R11','Kensington 189  R03','Kensington 189  R01','Kensington 148  R40','Kensington 148  R39','Kensington 148  R10','Kensington 148  R09','Belgravia Herringbone  R21','Belgravia Herringbone  R20','Belgravia Herringbone  R19','Hampstead  D0108L','Walnut Flooring  D0180','Hampstead  R41','Hampstead  R30',];
                    var matches = [];
                    for (i=0; i<choices.length; i++)
                        if (~choices[i].toLowerCase().indexOf(term)) matches.push(choices[i]);
                    suggest(matches);
                }
            });

It seems to be near identical to the code used in the pixabay demos. I've fiddled around a bit without luck.

Anyone have any ideas?

Thanks

Matt

1

There are 1 answers

0
mantagen On

Solved.

The choices were loaded in a PHP loop and I'd left a trailing comma.

This didn't matter in later browsers but IE8 was having none of it.