A summary of ComboBox multiple-selection incompatibility issues in jquery

Source: Internet
Author: User

  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.    
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.