pixabay jquery autoComplete在IE8中不起作用

时间:2015-06-17 12:31:06

标签: jquery internet-explorer autocomplete jquery-autocomplete

我正在使用pixabay's jquery autoComplete plugin 在此页http://xf.saminaraza.com/order-samples/

它在大多数浏览器上运行良好。然而,尽管IE8上的演示工作正常,但autoComplete仍无法在IE8上运行。

这是调用autoComplete的地方:

$('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);
                }
            });

它似乎与pixabay演示中使用的代码几乎完全相同。 我没有运气就摆弄了一下。

有人有什么想法吗?

由于

马特

1 个答案:

答案 0 :(得分:0)

解决。

选项是在PHP循环中加载的,我留下了一个逗号。

这在后来的浏览器中并不重要,但IE8却没有。