0
I am trying to add the jQuery UI "Autocomplete Combobox" to my ASP.NET MVC project, but it says that the widget function is not a function.
jquery-3.1.1.min. js: 2 jQuery.Deferred Exception: $.widget is not a Function Typeerror: $.widget is not a Function
I’m following the example of jQuery’s website (jQuery UI tutorial), the difference is that I extracted the scripts for external file and the css as well.
I have already linked the scripts needed to use this function, which is in the following order:
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/jquery-ui.css")">
<link rel="stylesheet" type="text/css" href="@Url.Content("~/Content/app/cliente/meu-css.css")">
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-3.1.1.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/app/cliente/meu-script.js")"></script>
I repeated this example in the notepad and it worked, but in the MVC project it did not work.
You have some problem loading the JS that has the widget function, check the JS loaded in the page to know which one was not loaded
– Ricardo
Ricardo, all were loaded, including the jquery-ui.js that contains the function. I don’t understand this. :(
– Raphael