简体   繁体   English

TypeError:$(…).autocomplete不是函数

[英]TypeError: $(…).autocomplete is not a function

I am getting the above error using the following code inside a ASP.NET MVC 我在ASP.NET MVC中使用以下代码遇到上述错误

<script type="text/javascript" >
$(document).ready(function () {
    $("#Name").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/Home/Index",
                type: "POST",
                dataType: "json",
                data: { Prefix: request.term },
                success: function (data) {
                    response($.map(data, function (item) {
                        return { label: item.Name, value: item.Name };
                    })
                }
            })
        },
        messages: {
            noResults: "", results: ""
        }
    });
})

Jquery is definitely loaded, and I have tried using a different variable for $ - any ideas what else might be the problem? jQuery肯定已加载,并且我尝试为$使用其他变量-任何想法还有什么问题?

When you run the application on local and including libraries from server you need to write http:// or https:// before the link as when you upload the site on server its not necessary but its required on local 当您在本地运行应用程序并包括服务器中的库时,您需要在链接之前编写http://https:// ,就像在服务器上上传站点时一样,它不是必需的,但在本地上是必需的

<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

Or else download them or use from local path. 否则下载它们或从本地路径使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未捕获的TypeError:$(…).autocomplete不是函数 - Uncaught TypeError: $(…).autocomplete is not a function TypeError:$(…).autocomplete不是函数$(“#partipnt-name”)。autocomplete({ - TypeError: $(…).autocomplete is not a function $(“#partipnt-name”).autocomplete({ jQuery Uncaught TypeError:$(…).autocomplete不是函数 - jQuery Uncaught TypeError: $(…).autocomplete is not a function jQuery自动完成“ TypeError:回调不是函数” - jQuery Autocomplete “TypeError: callback is not a function” TypeError:elem.autocomplete不是函数 - TypeError: elem.autocomplete is not a function “未捕获的类型错误:$(...).autocomplete 不是函数”和 Oracle Apex - "Uncaught TypeError: $(...).autocomplete is not a function" and Oracle Apex Uncaught TypeError:未定义不是函数jQuery自动完成 - Uncaught TypeError: undefined is not a function jquery autocomplete Javascript,jquery错误TypeError:$(...)。autocomplete不是函数 - Javascript, jquery error TypeError: $(…).autocomplete is not a function jQuery自动完成 - 未捕获TypeError:undefined不是函数 - jQuery autocomplete - Uncaught TypeError: undefined is not a function jQuery自动完成-TypeError:自动完成不是ASP.NET MVC 5中的函数 - jQuery autocomplete - TypeError: autocomplete is not a function in asp.net mvc 5
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM