javascript - Object doesn't support this property or method - jquery - IE8 -


i'm beginner, have question issues.

i used jquery 1.11.1. on ie8, it's happen when page loaded, error on line 2 ( $(_label) undefined )

but checked $(_label).tostring() valid.

here code:

function autocompletedropdownmultivalue(_label, _hidden, _mysource) {     $(_label).autocomplete({             source: _mysource,             maxheight: 500,             width: 300,             select: function (event, ui) {                 var terms = split($(this).text());                 var index = searchitem(terms, ui.item.value);                 if (index == -1) {                     if (terms[0] == "click select")                         terms.pop();                     terms.push(ui.item.value);                     $(this).html("<b>" + terms.join(", ") + "</b>");                     $(_hidden).val(terms.join("|"));                 } else {                     terms.splice(index, 1);                     if (terms.length == 0) {                         terms.push("click select");                         $(this).html(terms);                         $(_hidden).val("");                     } else {                         $(this).html("<b>" + terms.join(",") + "</b>");                         $(_hidden).val(terms.join("|"));                     }                 }                 return false;             },             open: function () {                 $('.ui-autocomplete').css('width', '280px');                 $('.ui-autocomplete').css('height', 'auto');                 $('.ui-autocomplete').css('max-height', '800px');                 $('.ui-autocomplete').css('overflow-y', 'auto');             }         })         .data("ui-autocomplete")._renderitem = function (ul, item) {             var terms = split($(_label).text());             var index = searchitem(terms, item.value);             if (index == -1) {                 return $("<li>")                     .append("<a>" + item.label + "</a>")                     .appendto(ul);             } else {                 return $("<li>")                     .data("ui-autocomplete-item", item)                     .append("<a style='color:#ff5500;'>" + item.label + "</a>")                     .appendto(ul);             }         }; }  function showdropdownmultivalue(_label) {     $(_label).autocomplete("option", "minlength", 0);     if ($(_label).autocomplete("widget").is(':visible')) {         $(_label).autocomplete('close');         return;     } else {         $(_label).autocomplete("search", "");         $(_label).autocomplete("widget").show();         return;     } } 

thanks much.


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

php - Find a regex to take part of Email -