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 is as follows:
Copy Code 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, here's the error.
if (_7ed>=0) {
_7ec.splice (_7ed,1);
_7e7 (_7E9,_7EC);
That is, the IndexOf method is not supported in F12, and now there are two solutions to this problem:
1. Modify the source code
Amend the code above to
Copy Code 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 on 2013-6-25 19:04
_7ec.splice (_7ed,1);
_7e7 (_7E9,_7EC);
}</strong>
2. Add IndexOf method
Copy Code 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>
In fact, I still quite recommend the first method, because more convenient, I was the first way to use.