recently developed jquery in IE10, a summary of ComboBox in jquery, and interested friends can understand the following
Recently developed jquery in IE10, a summary of the incompatibility of ComboBox multiple selections in jquery. When you set the property "Multiple:true" to ComboBox, IE10 cannot complete the multiple selections, and the error follows: code as follows: function _7e8 (_7e9,_7ea) { var _7eb=$ . Data (_7e9, "combobox"); var opts=_7eb.options; var _7ec=$ (_7e9). Combo ("getValues"); var _7ed=_ 7ec.indexof (_7ea+ "")//10650 line here error if (_7ed>=0) { _7ec.splice (_7ed,1); _7e7 (_7E9,_7EC); The IndexOf method is not supported in F12, and there are now two solutions to this problem: 1. Modify source To change the above code to code as follows: <strong> function _7e8 (_7e9,_7ea) { var _7eb=$.data (_7e9, "combobox"); var opts=_7eb.options; var _7ec=$ (_7e9) . Combo ("getValues"); var _7ed = (function (arr,str) { str = str + ""; for (Var i=0,l=arr.length;i<l;i++ { if (arr[i] = = str) return i; } return-1; }) (_7ec,_7ea); if (_7ed >= 0) {//modified in 2013-6-25 19:04 _7ec.splice (_7ed,1); _7e7 (_7E9,_7EC); }</strong> 2. Add IndexOf method code as follows : <strong>iF (! ARRAY.PROTOTYPE.INDEXOF) { Array.prototype.indexOf = function (target) { for (Var i=0,l=this.length;i<l; i++) { if (this[i] = = target) return i; } return-1; }; }</strong> Actually, I'm still pretty pushing. Recommend the first method, because more convenient, I was the first way to use.