Jquery UI自动完成:未捕获TypeError:a(...)。addClass(...)。appendTo(...)。菜单不是函数

时间:2018-03-06 06:31:18

标签: javascript jquery jquery-ui autocomplete jquery-ui-autocomplete

错误堆栈

Uncaught TypeError: a(...).addClass(...).appendTo(...).menu is not a function
at a.(anonymous function).(anonymous function)._create (http://localhost/wordpress/wp-includes/js/jquery/ui/autocomplete.min.js:11:2166)
at a.(anonymous function).(anonymous function)._create (http://localhost/wordpress/wp-includes/js/jquery/ui/widget.min.js:11:1032)
at a.(anonymous function).(anonymous function)._createWidget (http://localhost/wordpress/wp-includes/js/jquery/ui/widget.min.js:11:3093)
at new a.(anonymous function).(anonymous function) (http://localhost/wordpress/wp-includes/js/jquery/ui/widget.min.js:11:593)
at HTMLInputElement.<anonymous> (http://localhost/wordpress/wp-includes/js/jquery/ui/widget.min.js:11:2365)
at Function.each (http://localhost/wordpress/wp-includes/js/jquery/jquery.js:2:2881)
at n.fn.init.each (http://localhost/wordpress/wp-includes/js/jquery/jquery.js:2:846)
at n.fn.init.a.fn.(anonymous function) [as autocomplete] (http://localhost/wordpress/wp-includes/js/jquery/ui/widget.min.js:11:2275)
at HTMLDocument.<anonymous> (http://localhost/wordpress/?__pm_frame=1:195:29)
at i (http://localhost/wordpress/wp-includes/js/jquery/jquery.js:2:27449)

脚本

$('#email-request').autocomplete({
    source: "<?php echo home_url( '/?task=findemails' ); ?>",
    minLength: 2,
});

HTML

<input id="email-request" type="text" name="email" class="form-control" placeholder="Start typing to see suggestions" required/>

源代码

显示它们已正确添加:)

Source code of added scripts

我尝试了什么......

我在四处寻找。找到了一些建议,包括jquery-ui-menu,我也这样做,但错误仍然存​​在。不确定是什么导致了这一点。任何帮助表示赞赏:)。

更新....

我厌倦了console.log($。fn.menu);,返回undefined。如果未包含菜单,则会返回undefined,但正如您在屏幕截图菜单中看到的那样。可能导致这种情况的原因是什么?

包含的菜单用户界面的详细信息

/*!
 * jQuery UI Menu 1.11.4
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 *
 * http://api.jqueryui.com/menu/
 */

0 个答案:

没有答案