jquery 3.1.0和jquery-ui autocomplete不兼容,有什么解决方法?

我无法让jQuery 3.1.0与jQuery UI的自动完成function一起使用。

我所知道的唯一解决方法是将jQuery 3.1.0替换为使用jquERY UI安装程序预先打包的那个。 不幸的是,这对我不起作用,因为jQuery UI的安装程序包中的版本不允许我使用我的网站所需的标签输入和其他现代function。

    $( function() { var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme" ]; $( "#tags" ).autocomplete({ source: availableTags }); } ); 

现在似乎工作得很好:

https://jsfiddle.net/jphellemons/0ukbtgs4/

  • jQuery 3.1.1
  • jQuery ui 1.12.1

用你的代码:

     
  • jQuery 3.1.1
  • jQuery ui 1.12.1

 $("#Your-Input").on('keypress', function() { $.ajax({ url: 'http://www.somehost.ru', dataType: "json", data: { text: $("#Your-Input").val() } }) .done(function(result) { //your handler here }); });